K - type of keysV - type of valuespublic class LRUMapSizeBound<K,V extends Cacheable>
extends java.util.LinkedHashMap<K,V>
NB: This implementation recalculates the combined size of all stored elements each time a new element is added, so it is not well suited to pushing a large number of cached items at a high rate.
| Constructor and Description |
|---|
LRUMapSizeBound(int maxSize)
Initializes a new instance of the
LRUMapSizeBound class with the specified capacity |
LRUMapSizeBound(int maxSize,
java.util.Map<? extends K,? extends V> values)
Initializes a new instance of the
LRUMapSizeBound class with the specified capacity and initial values |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
removeEldestEntry(java.util.Map.Entry<K,V> eldest) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic LRUMapSizeBound(int maxSize)
LRUMapSizeBound class with the specified capacitymaxSize - the maximum capacity for the LRUMapSizeBoundpublic LRUMapSizeBound(int maxSize,
java.util.Map<? extends K,? extends V> values)
LRUMapSizeBound class with the specified capacity and initial valuesmaxSize - the maximum capacity for the LRUMapSizeBoundvalues - initial values to populate the LRUMapSizeBoundCopyright © 2018 Frederic Thevenet. All rights reserved.