K
- The type of the map key.V
- The type of the map value.public class SoftHashMap<K,V>
extends java.util.AbstractMap<K,V>
This is similar to the standard WeakHashMap
, but it
uses SoftReference
s for the map's values instead
of WeakReference
s for the maps keys. Thus, an entry is removed
from the map when the JVM is low in memory and when the entry's value is
softly reachable.
Constructor and Description |
---|
SoftHashMap() |
SoftHashMap(int initialCapacity) |
SoftHashMap(int initialCapacity,
float loadFactor) |
SoftHashMap(java.util.Map<? extends K,? extends V> m) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
V |
put(K key,
V value) |
V |
remove(java.lang.Object key) |
int |
size() |
public SoftHashMap()
public SoftHashMap(int initialCapacity)
public SoftHashMap(int initialCapacity, float loadFactor)