T - the key typeU - the value typepublic class LruMap<T,U> extends LinkedHashMap<T,U>
Map.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
LruMap(int maxEntries)
Creates a new instance with the specified maximum number of allowed entries.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
removeEldestEntry(Map.Entry<T,U> eldest)
Returns
true if the HashMap.size() of this map exceeds the maximum number of allowed entries. |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic LruMap(int maxEntries)
protected boolean removeEldestEntry(Map.Entry<T,U> eldest)
true if the HashMap.size() of this map exceeds the maximum number of allowed entries.
Invoked by LinkedHashMap for LRU behavior.removeEldestEntry in class LinkedHashMap<T,U>Copyright © 2020 LeanCloud. All rights reserved.