K
- The type of the map key.V
- The type of the map value.public class SoftHashMap<K,V> extends 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.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
SoftHashMap() |
SoftHashMap(int initialCapacity) |
SoftHashMap(int initialCapacity,
float loadFactor) |
SoftHashMap(Map<? extends K,? extends V> m) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
V |
put(K key,
V value) |
V |
remove(Object key) |
int |
size() |
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
public SoftHashMap()
public SoftHashMap(int initialCapacity)
public SoftHashMap(int initialCapacity, float loadFactor)
Copyright © 2015. All rights reserved.