Package org.jruby.util.collections
Class WeakValuedMap<Key,Value>
java.lang.Object
org.jruby.util.collections.WeakValuedMap<Key,Value>
- All Implemented Interfaces:
Serializable,Map<Key,Value>
- Direct Known Subclasses:
WeakValuedIdentityMap
Map-like that holds its values weakly (backed by a concurrent hash map).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ReferenceQueue<Value>private final Map<Key,WeakValuedMap.KeyedReference<Key, Value>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()protected Map<Key,WeakValuedMap.KeyedReference<Key, Value>> newMap()Construct the backing store map for this WeakValuedMap.voidintsize()toString()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
map
-
deadRefs
-
-
Constructor Details
-
WeakValuedMap
public WeakValuedMap()
-
-
Method Details
-
put
-
get
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<Key,Value>
-
containsValue
- Specified by:
containsValuein interfaceMap<Key,Value>
-
remove
-
putAll
-
keySet
-
values
-
entrySet
-
toString
-
newMap
Construct the backing store map for this WeakValuedMap. It should be capable of safe concurrent read and write.- Returns:
- the backing store map
-
cleanReferences
private void cleanReferences()
-