java.lang.Object
java.util.AbstractMap<RemoteHostId, EstablishmentManager.Token>
java.util.HashMap<RemoteHostId, EstablishmentManager.Token>
java.util.LinkedHashMap<RemoteHostId, EstablishmentManager.Token>
net.i2p.util.LHMCache<RemoteHostId, EstablishmentManager.Token>
net.i2p.router.transport.udp.EstablishmentManager.InboundTokens
- All Implemented Interfaces:
Serializable, Cloneable, Map<RemoteHostId, EstablishmentManager.Token>, SequencedMap<RemoteHostId, EstablishmentManager.Token>
- Enclosing class:
EstablishmentManager
private class EstablishmentManager.InboundTokensextends LHMCache<RemoteHostId, EstablishmentManager.Token>
For inbound tokens only, to record eviction time in a stat, for use in setting expiration times.
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 booleanRemove the eldest entry, recording its eviction time.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
InboundTokens
public InboundTokens(int max) Creates the inbound token cache.- Parameters:
max- the maximum number of tokens held
Method Details
removeEldestEntry
Remove the eldest entry, recording its eviction time.- Overrides:
removeEldestEntryin classLHMCache<RemoteHostId, EstablishmentManager.Token>