org.biojava.utils.cache
Class WeakValueHashMap
java.lang.Object
java.util.AbstractMap
org.biojava.utils.cache.WeakValueHashMap
- All Implemented Interfaces:
- java.util.Map
- public class WeakValueHashMap
- extends java.util.AbstractMap
Map implementation which keeps weak references to values.
Entries are removed from the map when their value is
no longer reachable using normal (hard) references. This is
useful for maintaining canonical copies of objects without forcing
these objects to remain in memory forever.
Note that this is distinct from the standard library class,
WeakHashMap
which has weak keys.
- Since:
- 1.3
- Author:
- Thomas Down
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Method Summary |
boolean |
containsKey(java.lang.Object o)
|
java.util.Set |
entrySet()
|
java.lang.Object |
get(java.lang.Object key)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
Methods inherited from class java.util.AbstractMap |
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
WeakValueHashMap
public WeakValueHashMap()
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
get
public java.lang.Object get(java.lang.Object key)
containsKey
public boolean containsKey(java.lang.Object o)
entrySet
public java.util.Set entrySet()