number of such methods:
public VputIfAbsent(K key, V value)
Atomically stores the given value in the map only if a mapping for key does
not currently exist. The old value mapped to key is returned, or null if the
key was not presentbut be aware that null may be a legitimate value for
some maps. (Optional if the map does not support put)
public booleanremove(Object key, Object value)
Atomically remove the entry for key if it currently maps to value. Returns
true if the entry was removed. (Optional if the map does not support
remove)
public booleanreplace(K key, V oldValue, V newValue)
Atomically replaces the entry for key only if it currently maps to
oldValue. Returns true if the entry was replaced. (Optional if the map
does not support put)
public Vreplace(K key, V value)
Atomically replaces the mapping for key if and only if a mapping currently
exists. The old value mapped to key is returned, or null if the key was not
presentbut be aware that null may be a legitimate value for some maps.
(Optional if the map does not support put)
The ConcurrentLinkedQueue
node representation. Operations on the queue are highly concurrent and do not utilize locks. Because of the
concurrent nature an operation like size requires a complete traversal of the queue and so is quite
expensivehowever, knowing the size that a concurrently changing queue used to be is seldom, if ever, useful.
The iterator provided by ConcurrentLinkedQueue is weakly consistent, it guarantees to traverse the
elements that existed when the iterator was created, but may not reflect subsequent additions.
The CopyOnWriteArrayList
over a snapshot of the contents without actually making a copy of the original list. Copies are made only when
someone modifies the listhence the name "copy on write." This makes a very efficient structure for lists that
are read much more frequently than they are changed. Because the iterator sees a snapshot of the elements, it
can never fail; but it does not support the remove operation.
The CopyOnWriteArraySet
CopyOnWriteArrayList.
21.12. The Arrays Utility Class
The class Arrays provides useful static methods for dealing with arrays. Most of these methods have a full
complement of overloads: one for arrays of each primitive type (except boolean for searching and sorting)
and one for Object arrays. There are also two variants of some methods: one acting on the whole array and
one acting on the subarray specified by two supplied indices. The methods are
sort Sorts an array into ascending order. The exact algorithm is not specified other than it must be
stable for objects (that is, equal objects don't get reordered because of the sort). A good