public class ManagedIdentityConcurrentMap<K, V> extends ConcurrentReferenceHashMap
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.
K
- the key typeV
- the value typeConstructor and description |
---|
ManagedIdentityConcurrentMap() Creates a new, empty map with the key weak reference |
ManagedIdentityConcurrentMap(int initialCapacity) Creates a new, empty map with the key weak reference and the specified initial capacity |
ManagedIdentityConcurrentMap(ConcurrentReferenceHashMap.ReferenceType keyType) Creates a new, empty map with the specified key reference type |
ManagedIdentityConcurrentMap(ConcurrentReferenceHashMap.ReferenceType keyType, int initialCapacity) Creates a new, empty map with the specified key reference type and initial capacity |
Type Params | Return Type | Name and description |
---|---|---|
|
public V |
getOrPut(K key, V value) Get the key specified value, or put the default value and return it if the key is absent |
Methods inherited from class | Name |
---|---|
class ConcurrentReferenceHashMap |
apply, applyIfAbsent, applyIfPresent, cachedEntrySet, clear, contains, containsKey, containsValue, elements, entrySet, get, hashOf, isEmpty, keySet, keys, purgeStaleEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values |
Creates a new, empty map with the key weak reference
Creates a new, empty map with the key weak reference and the specified initial capacity
initialCapacity
- initial capacityCreates a new, empty map with the specified key reference type
keyType
- key reference typeCreates a new, empty map with the specified key reference type and initial capacity
keyType
- key reference typeinitialCapacity
- the initial capacityCopyright © 2003-2024 The Apache Software Foundation. All rights reserved.