Package org.biojava.utils.io
Class SoftHashMap
java.lang.Object
java.util.AbstractMap
org.biojava.utils.io.SoftHashMap
- All Implemented Interfaces:
Map
A in memory cache using soft references. (can be garbage collected)
This code is based on: http://java-interview-faqs.blogspot.com/2008/09/building-faster-and-efficient-cache.html
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
DEBUG
- See Also:
-
DEFAULT_LIMIT
- See Also:
-
-
Constructor Details
-
SoftHashMap
public SoftHashMap() -
SoftHashMap
-
-
Method Details
-
get
- Specified by:
getin interfaceMap- Overrides:
getin classAbstractMap
-
put
Here we put the key, value pair into the HashMap using a SoftValue object.- Specified by:
putin interfaceMap- Overrides:
putin classAbstractMap
-
remove
- Specified by:
removein interfaceMap- Overrides:
removein classAbstractMap
-
clear
- Specified by:
clearin interfaceMap- Overrides:
clearin classAbstractMap
-
size
- Specified by:
sizein interfaceMap- Overrides:
sizein classAbstractMap
-
entrySet
- Specified by:
entrySetin interfaceMap- Specified by:
entrySetin classAbstractMap
-