- java.lang.Object
-
- ch.bind.philib.cache.StagedLruCache<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_OLD_GEN_AFTER_HITSThe number of hits after which an entry is put into the old-generation lrustatic doubleDEFAULT_OLD_GEN_RATIOThe default capacity of an object cache relative to its capacity.-
Fields inherited from interface ch.bind.philib.cache.Cache
DEFAULT_CAPACITY
-
-
Constructor Summary
Constructors Constructor Description StagedLruCache()StagedLruCache(int capacity)StagedLruCache(int capacity, Cloner<V> valueCloner, double oldGenRatio, int oldGenAfterHits)StagedLruCache(Cloner<V> valueCloner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcapacity()voidclear()Remove all elements from the cache.Vget(K key)Query a value from the cache by its key.voidremove(K key)Remove a key-value-pair from the cache.voidset(K key, V value)Sets a key-value-pair to the cache.
-
-
-
Field Detail
-
DEFAULT_OLD_GEN_RATIO
public static final double DEFAULT_OLD_GEN_RATIO
The default capacity of an object cache relative to its capacity.- See Also:
- Constant Field Values
-
DEFAULT_OLD_GEN_AFTER_HITS
public static final int DEFAULT_OLD_GEN_AFTER_HITS
The number of hits after which an entry is put into the old-generation lru- See Also:
- Constant Field Values
-
-
Method Detail
-
set
public void set(K key, V value)
Description copied from interface:CacheSets a key-value-pair to the cache.
-
get
public V get(K key)
Description copied from interface:CacheQuery a value from the cache by its key.
-
remove
public void remove(K key)
Description copied from interface:CacheRemove a key-value-pair from the cache.
-
capacity
public int capacity()
-
-