Package com.googlecode.aviator.utils
Class LRUMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- com.googlecode.aviator.utils.LRUMap<K,V>
-
- Type Parameters:
K
-V
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<K,V>
public class LRUMap<K,V> extends java.util.LinkedHashMap<K,V>
LRU map based on LinkedHashMap- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxCapacity
(package private) static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description LRUMap(int maxCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get(java.lang.Object k)
V
put(K k, V v)
V
remove(java.lang.Object key)
protected boolean
removeEldestEntry(java.util.Map.Entry<K,V> eldest)
int
size()
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, getOrDefault, keySet, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace
-
-