Package es.bsc.dataclay.util.structs
Class LruCacheByDate<A,B>
- java.lang.Object
-
- es.bsc.dataclay.util.structs.LruCacheByDate<A,B>
-
- Type Parameters:
A- Key element classB- Value element class
public final class LruCacheByDate<A,B> extends Object
Class that implements a simple LRU cache with specified max entries.
-
-
Constructor Summary
Constructors Constructor Description LruCacheByDate(int theMaxEntries)LruCache constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanCache()Cleans expired entriesvoidclear()booleancontainsKey(A key)booleancontainsValue(B value)Set<Map.Entry<A,B>>entrySet()voidfinishCacheThreads()Finish cache threadsBget(A key)Set<A>keySet()Bput(A key, B value)voidputAll(Map<? extends A,? extends B> m)Bremove(A key)intsize()
-
-
-
Method Detail
-
cleanCache
public void cleanCache()
Cleans expired entries
-
containsKey
public boolean containsKey(A key)
-
containsValue
public boolean containsValue(B value)
-
size
public int size()
-
clear
public void clear()
-
finishCacheThreads
public void finishCacheThreads() throws InterruptedExceptionFinish cache threads- Throws:
InterruptedException- if shutdown was interrupted.
-
-