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 intmaxCapacity(package private) static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description LRUMap(int maxCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vget(java.lang.Object k)Vput(K k, V v)Vremove(java.lang.Object key)protected booleanremoveEldestEntry(java.util.Map.Entry<K,V> eldest)intsize()-
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
-
-