Class LoggingLRUMap<KEYTYPE,VALUETYPE>
java.lang.Object
java.util.AbstractMap<KEYTYPE,VALUETYPE>
java.util.HashMap<KEYTYPE,VALUETYPE>
java.util.LinkedHashMap<KEYTYPE,VALUETYPE>
com.helger.commons.collection.impl.CommonsLinkedHashMap<KEYTYPE,VALUETYPE>
com.helger.commons.collection.map.LRUMap<KEYTYPE,VALUETYPE>
com.helger.commons.collection.map.LoggingLRUMap<KEYTYPE,VALUETYPE>
- Type Parameters:
KEYTYPE- Map key typeVALUETYPE- Map value type
- All Implemented Interfaces:
ICommonsMap<KEYTYPE,,VALUETYPE> ICommonsOrderedMap<KEYTYPE,,VALUETYPE> ICloneable<ICommonsMap<KEYTYPE,,VALUETYPE>> Serializable,Cloneable,Map<KEYTYPE,,VALUETYPE> SequencedMap<KEYTYPE,VALUETYPE>
@NotThreadSafe
@UseDirectEqualsAndHashCode
public class LoggingLRUMap<KEYTYPE,VALUETYPE>
extends LRUMap<KEYTYPE,VALUETYPE>
A specific
LRUMap that emits a warning once the map is full and the
oldest entry gets discarded.- Author:
- Philip Helger
- 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 TypeMethodDescriptionbooleangetClone()inthashCode()protected voidonRemoveEldestEntry(int nSize, Map.Entry<KEYTYPE, VALUETYPE> aEntry) Protected method that is invoked every time the oldest entry is removed.final LoggingLRUMap<KEYTYPE, VALUETYPE> setMapName(String sMapName) toString()Methods inherited from class com.helger.commons.collection.map.LRUMap
getMaxSize, removeEldestEntryMethods inherited from class com.helger.commons.collection.impl.CommonsLinkedHashMap
createInstanceMethods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.collection.impl.ICommonsMap
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, setAllMethods inherited from interface com.helger.commons.collection.impl.ICommonsOrderedMap
copyOfEntrySet, copyOfKeySet, copyOfKeySet, getLastKey, getLastKey, getLastValue, getLastValueMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
LoggingLRUMap
-
LoggingLRUMap
-
-
Method Details
-
getClone
-
getMapName
-
setMapName
-
onRemoveEldestEntry
protected void onRemoveEldestEntry(@Nonnegative int nSize, @Nonnull Map.Entry<KEYTYPE, VALUETYPE> aEntry) Description copied from class:LRUMapProtected method that is invoked every time the oldest entry is removed.- Overrides:
onRemoveEldestEntryin classLRUMap<KEYTYPE,VALUETYPE> - Parameters:
nSize- Current size of the map. Always ≥ 0.aEntry- The map entry that is removed. Nevernull.
-
equals
-
hashCode
public int hashCode() -
toString
-