org.inria.myriads.snoozecommon.datastructure
K
- The keyV
- The valuepublic class LRUCache<K,V> extends LinkedHashMap<K,V> implements Serializable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LRUCache()
Empty constructor.
|
LRUCache(int maxCapacity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest)
Determines if the oldest element schould be removed.
|
clear, containsValue, get
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode, toString
public LRUCache()
public LRUCache(int maxCapacity)
maxCapacity
- The maximum capacityprotected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
eldest
- The eldest elementCopyright © 2013. All Rights Reserved.