A system of single-instance collections:
---------|CollectionRoot interface of a singleton collection
--------------|ListIf you implement the collection class for the list interface,Features: orderly, repeatableNote: Ordering in a collection does not refer to the natural order, but the order in which it is added is consistent with the order in which it comes out.
------------------|ArrayListThe ArrayList bottom maintains an object array implementation. (thread is not secure),Features: Fast query speed, and delete the slow speed. (orderly, repeatable)
------------------|LinkedListThe bottom of the LinkedList is implemented using a linked list structure,Features: Query speed is slow, adding and deleting faster. (orderly, repeatable)
------------------|Vector (Learn about it)The underlying is also the implementation of maintaining an object array, the implementation is the same as ArrayList, but the vector is thread-safe and operating inefficient
--------------|SetIf you implement a collection class for the set interface,Features: Unordered, non-repeatableNote: unordered in a collection does not refer to the natural order, but the order in which the elements are added is inconsistent with the order of the elements.
------------------|HashSetThe bottom layer is for a hash table to support,Features: storage speed block
------------------|TreeSetThe underlying is implemented using a red-black tree (binary tree) data structure that is not synchronized (that is, thread insecure) and cannot be shared among multiple threads, but can be synchronized using the Synchroinzedmap () method.feature: The elements are sorted by storage (in natural order)
Two-case Set system:
----------| Map If it is the implementation of the map interface collection class, has the characteristics: the stored data are in the form of key-value pairs exist, the key is not repeatable, the value can be repeated
--------------| HashMap
--------------| TreeMap
--------------| HashTable
Original Dshore Author's homepage:http://www.cnblogs.com/dshore123/ Source:https://www.cnblogs.com/dshore123/p/9104169.html Welcome reprint, reprint must explain the source. ( If this article is helpful to you, you can click on the lower right corner of the recommendation , or comments, thank you!) ) |
Java Foundation 35 Two-case set map and its common methods