Class SynchronizedExpiringLinkedHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- org.opennms.alec.processor.redundant.SynchronizedExpiringLinkedHashMap<K,V>
-
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
public class SynchronizedExpiringLinkedHashMap<K,V> extends LinkedHashMap<K,V>
A conditionally thread safeLinkedHashMapwith keys that expire automatically after a predetermined delay.This class is wrapped using
Collections.synchronizedMap(java.util.Map<K, V>). Iteration of this map must be done only after acquiring a lock on the instance of this map.- See Also:
- Serialized Form
-
-
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>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Vput(K key, V value)voidputAll(Map<? extends K,? extends V> m)VputIfAbsent(K key, V value)Vreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)voidreplaceAll(BiFunction<? super K,? super V,? extends V> function)-
Methods inherited from class java.util.LinkedHashMap
containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, remove, remove, size
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, remove, remove, size
-
-
-
-
Method Detail
-
clear
public void clear()
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsentin interfaceMap<K,V>- Overrides:
putIfAbsentin classHashMap<K,V>
-
replaceAll
public void replaceAll(BiFunction<? super K,? super V,? extends V> function)
- Specified by:
replaceAllin interfaceMap<K,V>- Overrides:
replaceAllin classLinkedHashMap<K,V>
-
-