Package net.datenwerke.rs.utils.misc
Class TimeoutHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
net.datenwerke.rs.utils.misc.TimeoutHashMap<K,V>
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
A Hashmap keeping entries no longer than a certain time
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeRemove(K key, V value) booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()longbooleanisEmpty()keySet()voidsetTimeout(long timeout) intsize()values()Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, newHashMap, putAll, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
TimeoutHashMap
public TimeoutHashMap(long timeout)
-
-
Method Details
-
beforeRemove
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classHashMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classHashMap<K,V>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
size
public int size() -
values
-
remove
-
getTimeout
public long getTimeout() -
setTimeout
public void setTimeout(long timeout)
-