<b>concurrent collection</b>
Class Name | Java Collections Framework Interface | Elements Ordered? | Sorted? | Blocking?
----- | ----- | ----- | ----- | -----
ConcurrentHashMap | ConcurrentMap | No | No | No
ConcurrentLinkedDeque | Deque | Yes | No | No
ConcurrentLinkedQueue | Queue | Yes | No | No
ConcurrentSkipListMap | ConcurrentMap<br>SortedMap<br>NavigableMap | Yes | Yes | No
ConcurrentSkipListSet | SortedSet<br>NavigableSet | Yes | Yes | No
CopyOnWriteArrayList | List | Yes | No | No
CopyOnWriteArraySet | Set | No | No | No
LinkedBlockingDeque | BlockingQueue<br>BlockingDeque | Yes | No | Yes
LinkedBlockingQueue | BlockingQueue | Yes | No | Yes
<b>BlockingQueue waiting methods</b>
Method Name | Description
----- | -----
offer(E e, long timeout, TimeUnit unit) | Adds item to the queue waiting the specified time, returning false if time elapses before space is available
poll(long timeout, TimeUnit unit) | Retrieves and removes an item from the queue, waiting the specified time, returning null if the time elapses before the item is available
<b>BlockingDeque waiting methods</b>
Method | Name Description
----- | -----
offerFirst(E e, long timeout, TimeUnit unit) | Adds an item to the front of the queue, waiting a
specified time, returning false if time elapses before space is available
offerLast(E e, long timeout, TimeUnit unit) | Adds an item to the tail of the queue, waiting a specified time, returning false if time elapses before space is available
<b>Synchronized collections methods</b>
Besides the concurrent collection classes that we have covered, the Concurrency API also includes methods for obtaining synchronized versions of existing non-concurrent collection objects. These methods, defined in the Collections class, contain synchronized methods that operate on the inputted collection and return a reference that is the same type as the underlying collection.
| Method Name |
| ----- |
| synchronizedCollection(Collection<T> c) |
| synchronizedList(List<T> list) |
| synchronizedMap(Map<K,V> m) |
| synchronizedNavigableMap(NavigableMap<K,V> m) |
| synchronizedNavigableSet(NavigableSet<T> s) |
| synchronizedSet(Set<T> s) |
| synchronizedSortedMap(SortedMap<K,V> m) |
| synchronizedSortedSet(SortedSet<T> s) |