Class LRUMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- org.terrier.structures.collections.LRUMap<K,V>
-
- Type Parameters:
K
- type of the keyV
- type of the parameter
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<K,V>
public final class LRUMap<K,V> extends java.util.LinkedHashMap<K,V>
A map with a fixed maximum size. The eldest entry will be removed when the maximum size is reached- Since:
- 3.0
- Author:
- Rodrygo Santos
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SIZE
DEFAULT_SIZE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
removeEldestEntry(java.util.Map.Entry<K,V> eldest)
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
DEFAULT_SIZE- See Also:
- Constant Field Values
-
-