av.util
Class WeakValueMap<K,V>
java.lang.Object
av.util.RefValueMap<K,V>
av.util.WeakValueMap<K,V>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<V>
public class WeakValueMap<K,V>
- extends RefValueMap<K,V>
This is the weak reference version of mem sensitive maps those do not prevent
the values from being garbage collected.
As WeakHashMap is implemented with weak keys,
it will not prevent the key from being discarded by the garbage collector. A
WeakHashMap is useful in many cases but it doesn't cover
the case that keys are constants like ( i.e. primitives and interned strings ),
while the values should be garbage collectable while no strong references to
them were held anymore. In these particular cases using a
WeakHashMap is either unexpectable or has no advantage at
all -- Boxed up primitives may be too soon discarded while interned strings
are almost never garbage collected. This class and other subclasses of
RefValueMap are here to fill this vacancy.
- Author:
- Compl
- See Also:
RefValueMap,
SoftValueMap,
Serialized Form
| Methods inherited from class av.util.RefValueMap |
clear, clone, containsKey, equals, get, hashCode, iterator, keySet, put, putAll, remove |
WeakValueMap
public WeakValueMap()
WeakValueMap
public WeakValueMap(int initialCapacity,
float loadFactor)
WeakValueMap
public WeakValueMap(int initialCapacity)
createReference
protected WeakReference<V> createReference(V v)
- Specified by:
createReference in class RefValueMap<K,V>
Copyright© 2006 Ableverse Platform. All rights reserved.