Package com.zfabrik.resources.util
Class ExpirableValuesPseudoMap<K,V,U>
- java.lang.Object
-
- com.zfabrik.resources.util.ExpirableValuesPseudoMap<K,V,U>
-
public class ExpirableValuesPseudoMap<K,V,U> extends java.lang.Object
A map wrapper that manages a map over expirable values. Note: if an invalidation queue has been set, this map will NOT remove invalidated values from the map but relies on external processing to do so.- Author:
- hb
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ExpirableValuesPseudoMap.ValueHolder
-
Constructor Summary
Constructors Constructor Description ExpirableValuesPseudoMap()
ExpirableValuesPseudoMap(int initialSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get(K key)
int
getMaxSize()
long
getNextTime()
int
getShrinks()
java.util.Map<K,ExpirableValuesPseudoMap.ValueHolder>
map()
ExpirableValuesPseudoMap.ValueHolder
put(K key, V value)
V
remove(K key)
void
resetStats()
java.util.Queue<ExpirableValuesPseudoMap.ValueHolder>
setExpirationQueue(java.util.Queue<ExpirableValuesPseudoMap.ValueHolder> q)
java.util.Queue<ExpirableValuesPseudoMap.ValueHolder>
setInvalidationQueue(java.util.Queue<ExpirableValuesPseudoMap.ValueHolder> q)
void
setTickOpCount(int n)
void
setTickTimeDelta(int n)
void
tick()
-
-
-
Field Detail
-
HARD
public static final short HARD
- See Also:
- Constant Field Values
-
SOFT
public static final short SOFT
- See Also:
- Constant Field Values
-
WEAK
public static final short WEAK
- See Also:
- Constant Field Values
-
-
Method Detail
-
resetStats
public void resetStats()
-
getMaxSize
public int getMaxSize()
-
getShrinks
public int getShrinks()
-
getNextTime
public long getNextTime()
-
setExpirationQueue
public java.util.Queue<ExpirableValuesPseudoMap.ValueHolder> setExpirationQueue(java.util.Queue<ExpirableValuesPseudoMap.ValueHolder> q)
-
setInvalidationQueue
public java.util.Queue<ExpirableValuesPseudoMap.ValueHolder> setInvalidationQueue(java.util.Queue<ExpirableValuesPseudoMap.ValueHolder> q)
-
map
public java.util.Map<K,ExpirableValuesPseudoMap.ValueHolder> map()
-
put
public ExpirableValuesPseudoMap.ValueHolder put(K key, V value)
-
setTickTimeDelta
public void setTickTimeDelta(int n)
-
setTickOpCount
public void setTickOpCount(int n)
-
tick
public void tick()
-
-