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 TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) private ConcurrentWeakValueHashMap.MyReference<K,
V> entrySet()
boolean
isEmpty()
keySet()
private void
void
putIfAbsent
(K key, V value) boolean
boolean
int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
putIfAbsent
in interfaceConcurrentMap<K,
V> - Specified by:
putIfAbsent
in interfaceMap<K,
V>
-
remove
-
replace
-
replace
-
remove
-
putAll
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
keySet
-
values
-
entrySet
-
toString
-