public class LRUCache<K,V>
extends java.util.LinkedHashMap<K,V>
| Constructor and Description |
|---|
LRUCache(int maxSize)
Creates an LRU cache with the given maximum size
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
removeEldestEntry(java.util.Map.Entry<K,V> eldest)
Determines if the eldest entry in the map should be removed.
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic LRUCache(int maxSize)
maxSize - the maximum size of the cache