java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
io.sf.jclf.util.CacheMap<K,V>
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<K,
V>
A HashMap-based cache with an expiration method
Note that there are better ways to achieve expirations in modern JDKs.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.util.HashMap
compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
lastacc
-
t
protected long t
-
-
Constructor Details
-
CacheMap
public CacheMap() -
CacheMap
public CacheMap(int initialCapacity) -
CacheMap
public CacheMap(int initialCapacity, float loadFactor)
-
-
Method Details
-
clear
public void clear() -
clone
-
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - Overrides:
containsKey
in classHashMap<K,
V>
-
get
-
put
-
remove
-
expire
public void expire(int exptime)
-