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 TypeMethodDescriptionvoidclear()Clear the map.booleancontainsKey(Object key) Test if key contained.booleancontainsValue(Object value) Test if value contained.entrySet()Get the entries.protected final voidRemove garbage collected entries.Get value for key.booleanisEmpty()Check if empty.keySet()Get the key set.Add value for key.voidAdd all mappings.Remove value for key.intsize()Get the size.values()Get the values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
containsKeyin interfaceMap<K,V>
-
containsValue
Test if value contained.- Specified by:
containsValuein 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.
-