org.codehaus.gpars

groovyx.gpars.extra166y
[Java] Interface CustomConcurrentHashMap.MappingFunction


public static interface CustomConcurrentHashMap.MappingFunction

A function computing a mapping from the given key to a value, or null if there is no mapping.


Method Summary
java.lang.Object map(java.lang.Object key)

Returns a value for the given key, or null if there is no mapping.

 

Method Detail

map

public java.lang.Object map(java.lang.Object 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


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.