Package org.jruby.util.collections
Class WeakValuedMap<Key,Value>
java.lang.Object
org.jruby.util.collections.WeakValuedMap<Key,Value>
- Type Parameters:
Key
- keyValue
- 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 Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
isEmpty()
keySet()
protected Map
<Key, WeakValuedMap.KeyedReference<Key, Value>> newMap()
Construct the backing store map for this WeakValuedMap.void
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.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
WeakValuedMap
public WeakValuedMap()
-
-
Method Details
-
put
-
get
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<Key,
Value>
-
containsValue
- Specified by:
containsValue
in 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
-