Package org.biojava.nbio.core.util
Class SoftHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.biojava.nbio.core.util.SoftHashMap<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
public class SoftHashMap<K,V> extends java.util.AbstractMap<K,V>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
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LIMIT
-
Constructor Summary
Constructors Constructor Description SoftHashMap()SoftHashMap(int hardSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()java.util.Set<java.util.Map.Entry<K,V>>entrySet()Vget(java.lang.Object key)Vput(K key, V value)Here we put the key, value pair into the HashMap using a SoftValue object.Vremove(java.lang.Object key)intsize()-
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
-
-
-
-
Field Detail
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMIT
- See Also:
- Constant Field Values
-
-