Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public interface ConcurrentMap<K, V>
ExtendsMap<K, V>
Known subtypesConcurrentHashMap
A map whose compound operations are atomic. The four methods it declares
are default methods of
Map as well; an implementation makes them atomic.Methods
public abstract V putIfAbsent(K key, V value) | If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value. |
public abstract boolean remove(Object key, Object value) | Removes the entry for the specified key only if it is currently mapped to the specified value. |
public abstract V replace(K key, V value) | Replaces the entry for the specified key only if it is currently mapped to some value. |
public abstract boolean replace(K key, V oldValue, V newValue) | Replaces the entry for the specified key only if currently mapped to the specified value. |
Inherited nested types
Inherited methods
Method details
putIfAbsent
public abstract V putIfAbsent(K key, V value)If the specified key is not already associated with a value (or is
mapped to
null) associates it with the given value and returns
null, else returns the current value.remove
public abstract boolean remove(Object key, Object value)Removes the entry for the specified key only if it is currently
mapped to the specified value.
replace
public abstract V replace(K key, V value)Replaces the entry for the specified key only if it is currently
mapped to some value.
replace
public abstract boolean replace(K key, V oldValue, V newValue)Replaces the entry for the specified key only if currently mapped
to the specified value.