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, get
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode, toString
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.