Package gw.util.concurrent
Class ConcurrentWeakValueHashMap<K,V>
java.lang.Object
gw.util.concurrent.ConcurrentWeakValueHashMap<K,V>
- All Implemented Interfaces:
ConcurrentMap<K,,V> Map<K,V>
Adapted from com.intellij.util.containers.ConcurrentWeakValueHashMap
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<K,ConcurrentWeakValueHashMap.MyReference<K, V>> private final ReferenceQueue<V> -
Constructor Summary
ConstructorsConstructorDescriptionConcurrentWeakValueHashMap(int initialCapacity) ConcurrentWeakValueHashMap(int initialCapaciy, float loadFactor, int concurrenycLevel) ConcurrentWeakValueHashMap(Map<K, V> map) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) private ConcurrentWeakValueHashMap.MyReference<K,V> entrySet()booleanisEmpty()keySet()private voidvoidputIfAbsent(K key, V value) booleanbooleanintsize()toString()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
-
Field Details
-
myMap
-
myQueue
-
-
Constructor Details
-
ConcurrentWeakValueHashMap
-
ConcurrentWeakValueHashMap
public ConcurrentWeakValueHashMap() -
ConcurrentWeakValueHashMap
public ConcurrentWeakValueHashMap(int initialCapacity) -
ConcurrentWeakValueHashMap
public ConcurrentWeakValueHashMap(int initialCapaciy, float loadFactor, int concurrenycLevel)
-
-
Method Details
-
processQueue
private void processQueue() -
get
-
put
-
createRef
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V>
-
remove
-
replace
-
replace
-
remove
-
putAll
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
keySet
-
values
-
entrySet
-
toString
-