| java.util.HashMap net.sourceforge.jtds.jdbc.cache.SimpleLRUCache
SimpleLRUCache | public class SimpleLRUCache extends HashMap (Code) | | Simple LRU cache for any type of object. Implemented as an extended
HashMap with a maximum size and an aggregated List
as LRU queue.
author: Brett Wooldridge version: $Id: SimpleLRUCache.java,v 1.1 2005/04/25 11:46:56 alin_sinpalean Exp $ |
Constructor Summary | |
public | SimpleLRUCache(int maxCacheSize) Constructs a new LRU cache instance. |
Method Summary | |
public synchronized void | clear() Overrides clear() to also clear the LRU list. | public synchronized Object | get(Object key) Overrides get() so that it also updates the LRU list. | public synchronized Object | put(Object key, Object value) Overrides put() so that it also updates the LRU list. | public synchronized Object | remove(Object key) |
SimpleLRUCache | public SimpleLRUCache(int maxCacheSize)(Code) | | Constructs a new LRU cache instance.
Parameters: maxCacheSize - the maximum number of entries in this cache beforeentries are aged off |
clear | public synchronized void clear()(Code) | | Overrides clear() to also clear the LRU list.
|
get | public synchronized Object get(Object key)(Code) | | Overrides get() so that it also updates the LRU list.
Parameters: key - key with which the expected value is associated the value to which the cache maps the specified key, ornull if the map contains no mapping for this key |
put | public synchronized Object put(Object key, Object value)(Code) | | Overrides put() so that it also updates the LRU list.
Parameters: key - key with which the specified value is to be associated Parameters: value - value to be associated with the key previous value associated with key or null if therewas no mapping for key; a null return can alsoindicate that the cache previously associated null with the specified key See Also: java.util.Map.put(ObjectObject) |
|
|