java.lang.Object
java.util.AbstractMap<Long, PeerStateDestroyed>
java.util.HashMap<Long, PeerStateDestroyed>
java.util.LinkedHashMap<Long, PeerStateDestroyed>
net.i2p.util.LHMCache<Long, PeerStateDestroyed>
net.i2p.router.transport.udp.UDPTransport.DestroyedCache
- All Implemented Interfaces:
Serializable, Cloneable, Map<Long, PeerStateDestroyed>, SequencedMap<Long, PeerStateDestroyed>
- Enclosing class:
UDPTransport
For PeerStateDestroyed, to kill the timers on overflow, else the memory won't be freed.
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionprotected booleanremoveEldestEntry(Map.Entry<Long, PeerStateDestroyed> eldest) Remove the eldest entry and kill its timers.Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
Constructor Details
DestroyedCache
public DestroyedCache(int max) Maximum threshold.- Parameters:
max- the maximum number of entries kept before eviction
Method Details
removeEldestEntry
Remove the eldest entry and kill its timers.- Overrides:
removeEldestEntryin classLHMCache<Long, PeerStateDestroyed>- Parameters:
eldest- the least recently used entry- Returns:
- true if the entry was evicted