av.util
Class SoftValueMap<K,V>
java.lang.Object
av.util.RefValueMap<K,V>
av.util.SoftValueMap<K,V>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<V>
public class SoftValueMap<K,V>
- extends RefValueMap<K,V>
This is the soft 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,
WeakValueMap,
Serialized Form
| Methods inherited from class av.util.RefValueMap |
clear, clone, containsKey, equals, get, hashCode, iterator, keySet, put, putAll, remove |
SoftValueMap
public SoftValueMap()
SoftValueMap
public SoftValueMap(int initialCapacity,
float loadFactor)
SoftValueMap
public SoftValueMap(int initialCapacity)
createReference
protected SoftReference<V> createReference(V v)
- Specified by:
createReference in class RefValueMap<K,V>
Copyright© 2006 Ableverse Platform. All rights reserved.