dip.misc
Class LRUCache
java.lang.Object
java.util.AbstractMap
java.util.HashMap
java.util.LinkedHashMap
dip.misc.LRUCache
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- public class LRUCache
- extends java.util.LinkedHashMap
Implements an LRU Cache; based on LinkedHashMap from JDK1.4
- See Also:
- Serialized Form
Constructor Summary |
LRUCache(int maxsize)
Creates an LRUCache with the given size. |
Method Summary |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
protected boolean |
removeEldestEntry(java.util.Map.Entry eldest)
Override to enable elimination of oldest entries |
Methods inherited from class java.util.LinkedHashMap |
clear, containsValue, get |
Methods inherited from class java.util.HashMap |
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
LRUCache
public LRUCache(int maxsize)
- Creates an LRUCache with the given size.
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
removeEldestEntry
protected boolean removeEldestEntry(java.util.Map.Entry eldest)
- Override to enable elimination of oldest entries
Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.