net.spy.cache
Class LRUCache<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
net.spy.cache.LRUCache<K,V>
- All Implemented Interfaces:
- Serializable, Cloneable, Map<K,V>
public class LRUCache<K,V>
- extends LinkedHashMap<K,V>
A fixed-size least-recently-used cache.
- See Also:
- Serialized Form
|
Constructor Summary |
LRUCache(int size)
Get an instance of LRUCache. |
LRUCache
public LRUCache(int size)
- Get an instance of LRUCache.
get
public V get(Object o)
- Get the object from the cache, and defereference it if it's a reference.
- Specified by:
get in interface Map<K,V>- Overrides:
get in class LinkedHashMap<K,V>
put
public V put(K key,
V val)
- Specified by:
put in interface Map<K,V>- Overrides:
put in class HashMap<K,V>
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry<K,V> e)
- Overrides:
removeEldestEntry in class LinkedHashMap<K,V>
Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.