K
- the keyV
- the valuepublic class SmallLRUCache<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
static <K,V> SmallLRUCache<K,V> |
newInstance(int size)
Create a new object with all elements of the given collection.
|
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
void |
setMaxSize(int size) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public static <K,V> SmallLRUCache<K,V> newInstance(int size)
K
- the key typeV
- the value typesize
- the number of elementspublic void setMaxSize(int size)
protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
Copyright © 2020 JBoss by Red Hat. All rights reserved.