public class SoftValueHashMap<K,V>
extends java.util.AbstractMap<K,V>
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.util.Map<K,java.lang.ref.SoftReference<V>> |
hash
The internal HashMap that will hold the SoftReference.
|
private java.lang.ref.ReferenceQueue<V> |
queue
Reference queue for cleared SoftReference objects.
|
private java.util.Map<java.lang.ref.Reference<? extends V>,K> |
reverseLookup |
private static long |
serialVersionUID |
Constructor and Description |
---|
SoftValueHashMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns a copy of the key/values in the map at the point of calling.
|
private void |
expungeStaleEntries() |
V |
get(java.lang.Object key) |
V |
put(K key,
V value) |
V |
remove(java.lang.Object key) |
int |
size() |
private static final long serialVersionUID
private final java.util.Map<K,java.lang.ref.SoftReference<V>> hash
private final java.lang.ref.ReferenceQueue<V> queue
public void clear()
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
private void expungeStaleEntries()
public V get(java.lang.Object key)
public V remove(java.lang.Object key)