A function computing a mapping from the given key to a value,
or null
if there is no mapping.
Type | Name and description |
---|---|
V |
map(K key) Returns a value for the given key, or null if there is no mapping. |
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.
key
- the (non-null) key