Package org.codehaus.groovy.util
Class ManagedConcurrentValueMap<K,V>
java.lang.Object
org.codehaus.groovy.util.ManagedConcurrentValueMap<K,V>
- Type Parameters:
K
- the key typeV
- the value type
This is a basic implementation of a map able to forget its values. This
map uses internally a ConcurrentHashMap, thus should be safe for concurrency.
hashcode and equals are used to find the entries and should thus be implemented
properly for the keys. This map does not support null keys.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ManagedConcurrentValueMap
-
-
Method Details
-
setBundle
Sets a new bundle used for reference creation. Be warned that older entries will not be changed by this- Parameters:
bundle
- - the ReferenceBundle
-
get
Returns the value stored for the given key at the point of call.- Parameters:
key
- a non null key- Returns:
- the value stored in the map for the given key
-
put
Sets a new value for a given key. an older value is overwritten.- Parameters:
key
- a non null keyvalue
- the new value
-