org.terrier.structures.collections
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:
- Serializable, Cloneable, Map<K,V>
public final class LRUMap<K,V>
- extends 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
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- DEFAULT_SIZE
- See Also:
- Constant Field Values
LRUMap
public LRUMap()
- default constructor
LRUMap
public LRUMap(String sMaxSize)
- constructor
- Parameters:
sMaxSize
-
LRUMap
public LRUMap(int _maxSize)
- constructor
- Parameters:
_maxSize
-
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
- Overrides:
removeEldestEntry
in class LinkedHashMap<K,V>
Terrier 3.6. Copyright © 2004-2011 University of Glasgow