Some of the Collections Framework
Introduction
For those unfamiliar with the Collections Framework, it offers a core set of interfaces. They are:
List
The List lines are for ordered collections, offering either indexed or sequential access. List implementations include ArrayList and LinkedList; ArrayList replaces the original Vector division.
Collection
A Collection is the foot line for sets and lists. It explains a generic group of elements with no particular features. There are no direct implementations of Collection, only sub-interface executions.
Identity Map
It is another J2SE 1.4 implementation and is known as IdentityHashMap, which uses == instead of equals() for equality checking operations. For those interested in weak references, yet another map, WeakHashMap, is available that uses WeakReference for the keys, therefore dropping the key-value pair if the only reference to the value is through the input.
Map
It portrays collections of key-value pairs, similar to Hashtable. Available maps are HashMap and TreeMap; TreeMap is sorted and also implements SortedMap. J2SE 1.4 introduced two new implementations: LinkedHashSet and LinkedHashMap, for maintaining insertion order while needing constant times for operations like adding, searching, and relocating.
Set
A Set is a compilation of items that do not support duplicates. There are two standard Set implementations: HashSet and TreeSet; TreeSet is sorted and also application SortedSet.
Conclusion
The above mentioned aspects form the basic framework. By design, the framework is not thread-safe. Safe simultaneous access from multiple threads requires you to wrap the collection with a thread-safe wrapper. Similar wrappers exist for read-only versions of the collections.
Though the Collections Framework is relatively small, it is not meant to provide support for every data structure needed. Instead, it is only the framework from which you can build more specialized implementations.