KEYTYPE - Key typeVALUETYPE - Value type@NotThreadSafe @UseDirectEqualsAndHashCode public class LRUMap<KEYTYPE,VALUETYPE> extends CommonsLinkedHashMap<KEYTYPE,VALUETYPE>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
LRUMap(int nMaxSize)
Create a new object with the specified max size.
|
LRUMap(LRUMap<KEYTYPE,VALUETYPE> rhs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
LRUMap<KEYTYPE,VALUETYPE> |
getClone() |
int |
getMaxSize() |
int |
hashCode() |
protected void |
onRemoveEldestEntry(int nSize,
Map.Entry<KEYTYPE,VALUETYPE> aEldest)
Protected method that is invoked every time the oldest entry is removed.
|
protected boolean |
removeEldestEntry(Map.Entry<KEYTYPE,VALUETYPE> aEldest) |
String |
toString() |
createInstanceclear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizefinalize, getClass, notify, notifyAll, wait, wait, waitcopyOfEntrySet, copyOfKeySet, copyOfKeySet, getLastKey, getLastKey, getLastValue, getLastValueaddAll, 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, setAllclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic LRUMap(@Nonnegative int nMaxSize)
nMaxSize - The maximum number of elements in this cache. May not be < 0.@Nonnull public LRUMap<KEYTYPE,VALUETYPE> getClone()
getClone in interface ICommonsOrderedMap<KEYTYPE,VALUETYPE>getClone in interface ICloneable<ICommonsMap<KEYTYPE,VALUETYPE>>getClone in class CommonsLinkedHashMap<KEYTYPE,VALUETYPE>@Nonnegative public final int getMaxSize()
@OverrideOnDemand protected void onRemoveEldestEntry(@Nonnegative int nSize, @Nonnull Map.Entry<KEYTYPE,VALUETYPE> aEldest)
nSize - Current size of the map. Always ≥ 0.aEldest - The map entry that is removed. Never null.protected final boolean removeEldestEntry(@Nonnull Map.Entry<KEYTYPE,VALUETYPE> aEldest)
removeEldestEntry in class LinkedHashMap<KEYTYPE,VALUETYPE>public boolean equals(Object o)
public int hashCode()
public String toString()
toString in class AbstractMap<KEYTYPE,VALUETYPE>Copyright © 2014–2019 Philip Helger. All rights reserved.