KEYTYPE
- Map key typeVALUETYPE
- Map value type@NotThreadSafe @UseDirectEqualsAndHashCode public class LoggingLRUMap<KEYTYPE,VALUETYPE> extends LRUMap<KEYTYPE,VALUETYPE>
LRUMap
that emits a warning once the map is full and the
oldest entry gets discarded.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LoggingLRUMap(int nMaxSize) |
LoggingLRUMap(LoggingLRUMap<KEYTYPE,VALUETYPE> rhs) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
LoggingLRUMap<KEYTYPE,VALUETYPE> |
getClone() |
String |
getMapName() |
int |
hashCode() |
protected void |
onRemoveEldestEntry(int nSize,
Map.Entry<KEYTYPE,VALUETYPE> aEntry)
Protected method that is invoked every time the oldest entry is removed.
|
LoggingLRUMap<KEYTYPE,VALUETYPE> |
setMapName(String sMapName) |
String |
toString() |
getMaxSize, removeEldestEntry
createInstance
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
finalize, getClass, notify, notifyAll, wait, wait, wait
copyOfEntrySet, copyOfKeySet, copyOfKeySet, getLastKey, getLastKey, getLastValue, getLastValue
addAll, containsAnyEntry, containsAnyKey, containsAnyValue, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, findFirstEntry, findFirstKey, findFirstValue, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getAsUnmodifiable, getFirstEntry, getFirstEntry, getFirstKey, getFirstKey, getFirstValue, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, put, putAll, putAll, putAllMapped, putAllMapped, putAllMapped, putIf, putIfNotNull, removeAll, removeIf, removeIfKey, removeIfValue, removeObject, setAll
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public LoggingLRUMap(@Nonnegative int nMaxSize)
public LoggingLRUMap(@Nonnull LoggingLRUMap<KEYTYPE,VALUETYPE> rhs)
@Nonnull public LoggingLRUMap<KEYTYPE,VALUETYPE> getClone()
getClone
in interface ICommonsOrderedMap<KEYTYPE,VALUETYPE>
getClone
in interface ICloneable<ICommonsMap<KEYTYPE,VALUETYPE>>
getClone
in class LRUMap<KEYTYPE,VALUETYPE>
@Nonnull public final LoggingLRUMap<KEYTYPE,VALUETYPE> setMapName(@Nullable String sMapName)
protected void onRemoveEldestEntry(@Nonnegative int nSize, @Nonnull Map.Entry<KEYTYPE,VALUETYPE> aEntry)
LRUMap
onRemoveEldestEntry
in class LRUMap<KEYTYPE,VALUETYPE>
nSize
- Current size of the map. Always ≥ 0.aEntry
- The map entry that is removed. Never null
.public boolean equals(Object o)
public int hashCode()
Copyright © 2014–2019 Philip Helger. All rights reserved.