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:
Map<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 ClassesModifier and TypeClassDescriptionprivate static classA soft reference that has a hard reference to the key.Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<K, SoftValuesHashMap.SoftValue<V>> private final ReferenceQueue<V> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
map
-
queue
-
-
Constructor Details
-
SoftValuesHashMap
public SoftValuesHashMap()
-
-
Method Details
-
processQueue
private void processQueue() -
get
-
put
-
remove
-
clear
-
entrySet
-