Summary of the Java collection Framework
JavaCollection isJava provides a toolkit that contains commonly used data structures: collections, linked lists, queues, stacks, arrays, mappings, and so on. Javathe Collection Toolkit location isjava.util.*
JavaThe collection can be divided mainly into4sections:Listlist,SetCollection,Mapmappings, tool classes(Iteratoriterators,Enumerationenumeration classes,Arraysand thecollections).
Java Collection Toolkit Framework diagram ( below ):
General Description:
look at the frame chart above, first grab its trunk, i.e. Collection and Map.
1. Collection is an interface that is a highly abstracted collection that contains the basic operations and properties of a collection.
The Collection contains the List and Set two major branches :
List ordered queue , each element has its index. The index value of the first element is 0 list linkedlist, ArrayList, Vector, Stack
(Set is a collection that is not allowed to have duplicate elements. set hastset and hashset depends on hashmap It's actually through hashmap treeset depends on treemap treemap
2. Map is a mapped interface, which is a key-value Key-value pair. Each element in the MAP contains the " one key" and "key " corresponding to the value " .
Abstractmapis an abstract class that implements theMapmost of the interfacesAPI. andHashMap,TreeMap,Weakhashmapare inherited fromAbstractmap. Although Hashtable inherits from dictionary, it implements the map interface. Next, look atIterator. It is a tool for iterating over collections, that is, we usuallyIteratoriterator to iterate through the collection. We sayCollectionrelies onIterator, is becauseCollectionimplementation classes are implemented.iterator ()function (collection inherits the Itrable interface) and returns aIteratorobject. Listiteratoris specifically for traversingListand the existence of. Look againEnumeration, it isJDK 1.0the abstract class introduced. Role andIteratoras well as traversing the collection;Enumerationis more powerful thanIteratorless. In the block diagram above,Enumerationonly inHashtable, Vector, Stackused in the.
Finally, look at Arrays and collections. These are the two tool classes that manipulate arrays and collections.
Reference: http://www.cnblogs.com/skywang12345/p/3308498.html
The overall architecture of the Java collection