Package jadex.collection
Class WeakValueMap<K,V>
java.lang.Object
jadex.collection.WeakValueMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
A map with weak values.
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the map.boolean
containsKey
(Object key) Test if key contained.boolean
containsValue
(Object value) Test if value contained.entrySet()
Get the entries.protected final void
Remove garbage collected entries.Get value for key.boolean
isEmpty()
Check if empty.keySet()
Get the key set.Add value for key.void
Add all mappings.Remove value for key.int
size()
Get the size.values()
Get the values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
contents
The contents. -
queue
The reference queue.
-
-
Constructor Details
-
WeakValueMap
public WeakValueMap()Create a new weak value map.
-
-
Method Details
-
size
public int size()Get the size. -
isEmpty
public boolean isEmpty()Check if empty. -
containsKey
Test if key contained.- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
Test if value contained.- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
Get value for key. -
put
Add value for key. -
remove
Remove value for key. -
clear
public void clear()Clear the map. -
putAll
Add all mappings. -
keySet
Get the key set. -
values
Get the values. -
entrySet
Get the entries. -
expungeStaleEntries
protected final void expungeStaleEntries()Remove garbage collected entries.
-