Package org.h2.util
Class SoftValuesHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.h2.util.SoftValuesHashMap<K,V>
-
- Type Parameters:
K
- the key typeV
- the value type
- All Implemented Interfaces:
java.util.Map<K,V>
public class SoftValuesHashMap<K,V> extends java.util.AbstractMap<K,V>
Map which stores items using SoftReference. Items can be garbage collected and removed. It is not a general purpose cache, as it doesn't implement some methods, and others not according to the map definition, to improve speed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SoftValuesHashMap.SoftValue<T>
A soft reference that has a hard reference to the key.
-
Constructor Summary
Constructors Constructor Description SoftValuesHashMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.Object key)
private void
processQueue()
V
put(K key, V value)
Store the object.V
remove(java.lang.Object key)
Remove an object.-
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
-
-
-
-
Field Detail
-
map
private final java.util.Map<K,SoftValuesHashMap.SoftValue<V>> map
-
queue
private final java.lang.ref.ReferenceQueue<V> queue
-
-