T - The cache key type.V - The cache value type.public class LeastRecentlyUsed<T,V> extends LinkedHashMap<T,V>
Specially maintains a cache up to the size limit specified. After which point will start to discard entries in Least Recently Used order.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
LeastRecentlyUsed(int maxSize)
Constructs a new LeastRecentlyUsed cache.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxSize()
Get the maximum size of the cache.
|
protected boolean |
removeEldestEntry(Map.Entry<T,V> entry) |
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 LeastRecentlyUsed(int maxSize)
maxSize - The maximum size of the cache.protected boolean removeEldestEntry(Map.Entry<T,V> entry)
removeEldestEntry in class LinkedHashMap<T,V>public int getMaxSize()
Copyright © 2010–2023 Open Identity Platform Community. All rights reserved.