定义了几个原子的操作方法:
Method Summary | |
---|---|
V | putIfAbsent(K key, V value) If the specified key is not already associated with a value, associate it with the given value. |
boolean | remove(Object key, Object value) Removes the entry for a key only if currently mapped to a given value. |
V | replace(K key, V value) Replaces the entry for a key only if currently mapped to some value. |
boolean | replace(K key, V oldValue, V newValue) Replaces the entry for a key only if currently mapped to a given value. |
Method Summary | |
---|---|
V | putIfAbsent(K key, V value) If the specified key is not already associated with a value, associate it with the given value. |
boolean | remove(Object key, Object value) Removes the entry for a key only if currently mapped to a given value. |
V | replace(K key, V value) Replaces the entry for a key only if currently mapped to some value. |
boolean | replace(K key, V oldValue, V newValue) Replaces the entry for a key only if currently mapped to a given value. |