Package extra166y

Interface CustomConcurrentHashMap.MappingFunction<K,V>

Enclosing class:
CustomConcurrentHashMap<K,V>

public static interface CustomConcurrentHashMap.MappingFunction<K,V>
A function computing a mapping from the given key to a value, or null if there is no mapping.
  • Method Summary

    Modifier and Type
    Method
    Description
    map(K key)
    Returns a value for the given key, or null if there is no mapping.
  • Method Details

    • map

      V map(K key)
      Returns a value for the given key, or null if there is no mapping. If this function throws an (unchecked) exception, the exception is rethrown to its caller, and no mapping is recorded. Because this function is invoked within atomicity control, the computation should be short and simple. The most common usage is to construct a new object serving as an initial mapped value.
      Parameters:
      key - the (non-null) key
      Returns:
      a value, or null if none