Package com.gengoai.cache
Class AutoCalculatingLRUCache<K,V>
- java.lang.Object
-
- com.gengoai.cache.LRUCache<K,V>
-
- com.gengoai.cache.AutoCalculatingLRUCache<K,V>
-
- Type Parameters:
K
- the type parameterV
- the type parameter
- All Implemented Interfaces:
Cache<K,V>
public class AutoCalculatingLRUCache<K,V> extends LRUCache<K,V>
Auto calculating LRU cache that calculates values for keys when retrieved using aSerializableFunction
.- Author:
- David B. Bracewell
-
-
Constructor Summary
Constructors Constructor Description AutoCalculatingLRUCache(int maxSize, SerializableFunction<K,V> valueCalculator)
Instantiates a new Auto calculating lru cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get(K key)
Gets the value associated with a keyString
toString()
-
Methods inherited from class com.gengoai.cache.LRUCache
containsKey, get, invalidate, invalidateAll, put, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.cache.Cache
invalidateAll, isEmpty
-
-
-
-
Constructor Detail
-
AutoCalculatingLRUCache
public AutoCalculatingLRUCache(int maxSize, SerializableFunction<K,V> valueCalculator)
Instantiates a new Auto calculating lru cache.- Parameters:
maxSize
- the max sizevalueCalculator
- the value calculator
-
-