Interface ConcurrentMap<K,V>

All Superinterfaces:
Map<K,V>
All Known Implementing Classes:
ConcurrentHashMap

public interface ConcurrentMap<K,V> extends Map<K,V>
A map whose compound operations are atomic. The four methods it declares are default methods of Map as well; an implementation makes them atomic.
  • Method Details

    • putIfAbsent

      V putIfAbsent(K key, V value)
      Description copied from interface: Map
      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.
      Specified by:
      putIfAbsent in interface Map<K,V>
    • remove

      boolean remove(Object key, Object value)
      Description copied from interface: Map
      Removes the entry for the specified key only if it is currently mapped to the specified value.
      Specified by:
      remove in interface Map<K,V>
    • replace

      V replace(K key, V value)
      Description copied from interface: Map
      Replaces the entry for the specified key only if it is currently mapped to some value.
      Specified by:
      replace in interface Map<K,V>
    • replace

      boolean replace(K key, V oldValue, V newValue)
      Description copied from interface: Map
      Replaces the entry for the specified key only if currently mapped to the specified value.
      Specified by:
      replace in interface Map<K,V>