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 void
cleanCache()
Cleans expired entriesvoid
clear()
boolean
containsKey(A key)
boolean
containsValue(B value)
Set<Map.Entry<A,B>>
entrySet()
void
finishCacheThreads()
Finish cache threadsB
get(A key)
Set<A>
keySet()
B
put(A key, B value)
void
putAll(Map<? extends A,? extends B> m)
B
remove(A key)
int
size()
-
-
-
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 InterruptedException
Finish cache threads- Throws:
InterruptedException
- if shutdown was interrupted.
-
-