K
- the type of keys maintained by this mapV
- the type of mapped valuespublic class AccessBasedLRUCache<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
AccessBasedLRUCache(int maxSize,
int initialCapacity,
float loadFactor)
Create a new cache.
|
Modifier and Type | Method and Description |
---|---|
boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
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 AccessBasedLRUCache(int maxSize, int initialCapacity, float loadFactor)
maxSize
- the maximum size of the cache before it starts evicting elements.initialCapacity
- pre-allocated capacity for the cache.loadFactor
- the load factorpublic boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.