public class LRUMap<A,B> extends LinkedHashMap<A,B>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
LRUMap(int maxEntries) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
removeEldestEntry(Map.Entry<A,B> eldest)
Returns
true if this LruCache has more entries than
the maximum specified when it was created. |
void |
resize(int maxEntries) |
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, sizeprotected boolean removeEldestEntry(Map.Entry<A,B> eldest)
true if this LruCache has more entries than
the maximum specified when it was created.
Map; it
relies on the implementation of LinkedHashMap to do that,
but that behavior is documented in the JavaDoc for
LinkedHashMap.
removeEldestEntry in class LinkedHashMap<A,B>eldest - the Entry in question; this implementation
doesn't care what it is, since the implementation is only dependent on
the size of the cachetrue if the oldestLinkedHashMap.removeEldestEntry(Map.Entry)public void resize(int maxEntries)
Copyright © 2021 vpc open source initiative. All rights reserved.