info.aduna.collections
Class LRUMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
info.aduna.collections.LRUMap<K,V>
- Type Parameters:
K - the type of the keys in the mappingV - the type of the values in the mapping
- All Implemented Interfaces:
- Serializable, Cloneable, Map<K,V>
public class LRUMap<K,V>
- extends LinkedHashMap<K,V>
Map implementation providing an LRU algorithm and an optional maximum size.
Based on java.util.LinkedHashMap.
- Author:
- Herko ter Horst
- See Also:
- Serialized Form
|
Constructor Summary |
LRUMap()
|
LRUMap(int maxSize)
|
LRUMap(int maxSize,
int initialCapacity)
|
LRUMap(int maxSize,
int initialCapacity,
float loadFactor)
|
LRUMap(Map<? extends K,? extends V> m)
|
| Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
LRUMap
public LRUMap()
LRUMap
public LRUMap(int maxSize)
LRUMap
public LRUMap(int maxSize,
int initialCapacity)
LRUMap
public LRUMap(int maxSize,
int initialCapacity,
float loadFactor)
LRUMap
public LRUMap(Map<? extends K,? extends V> m)
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry<K,V> entry)
- Overrides:
removeEldestEntry in class LinkedHashMap<K,V>
getMaxSize
public int getMaxSize()
setMaxSize
public void setMaxSize(int i)
Copyright © 1997-2008 Aduna. All Rights Reserved.