Class ManagedIdentityConcurrentMap<K,V> 
java.lang.Object
java.util.AbstractMap<K,V>
 
org.apache.groovy.util.concurrent.ConcurrentReferenceHashMap<K,V>
 
org.apache.groovy.util.concurrent.ManagedIdentityConcurrentMap<K,V> 
- Type Parameters:
- K- the key type
- V- the value type
- All Implemented Interfaces:
- Serializable,- Map<K,- V> 
This is a basic implementation of a map able to forget its keys could be weak/soft/strong references. This
 bases on 
ConcurrentReferenceHashMap, thus it is safe for concurrency.
 This map compares keys through references.- Since:
- 4.0.0
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.groovy.util.concurrent.ConcurrentReferenceHashMapConcurrentReferenceHashMap.HashIterator, ConcurrentReferenceHashMap.InitializableEntry<K,V>, ConcurrentReferenceHashMap.Option, ConcurrentReferenceHashMap.ReferenceType, ConcurrentReferenceHashMap.SimpleEntry<K, V>, ConcurrentReferenceHashMap.WriteThroughEntry Nested classes/interfaces inherited from class java.util.AbstractMapAbstractMap.SimpleImmutableEntry<K extends Object,V extends Object> 
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new, empty map with the key weak referenceManagedIdentityConcurrentMap(int initialCapacity) Creates a new, empty map with the key weak reference and the specified initial capacityCreates a new, empty map with the specified key reference typeManagedIdentityConcurrentMap(ConcurrentReferenceHashMap.ReferenceType keyType, int initialCapacity) Creates a new, empty map with the specified key reference type and initial capacity
- 
Method SummaryMethods inherited from class org.apache.groovy.util.concurrent.ConcurrentReferenceHashMapapply, applyIfAbsent, applyIfPresent, cachedEntrySet, clear, contains, containsKey, containsValue, elements, entrySet, get, hashOf, isEmpty, keys, keySet, purgeStaleEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, size, valuesMethods inherited from class java.util.AbstractMapclone, equals, hashCode, toStringMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
- 
Constructor Details- 
ManagedIdentityConcurrentMappublic ManagedIdentityConcurrentMap()Creates a new, empty map with the key weak reference
- 
ManagedIdentityConcurrentMappublic ManagedIdentityConcurrentMap(int initialCapacity) Creates a new, empty map with the key weak reference and the specified initial capacity- Parameters:
- initialCapacity- initial capacity
 
- 
ManagedIdentityConcurrentMapCreates a new, empty map with the specified key reference type- Parameters:
- keyType- key reference type
 
- 
ManagedIdentityConcurrentMappublic ManagedIdentityConcurrentMap(ConcurrentReferenceHashMap.ReferenceType keyType, int initialCapacity) Creates a new, empty map with the specified key reference type and initial capacity- Parameters:
- keyType- key reference type
- initialCapacity- the initial capacity
 
 
- 
- 
Method Details- 
getOrPutGet the key specified value, or put the default value and return it if the key is absent- Parameters:
- key- the key to look up
- value- the default value if the key is absent
- Returns:
- the value
 
 
-