| java.lang.Object org.enhydra.jdbc.util.LRUCache
All known Subclasses: org.enhydra.jdbc.standard.PreparedStatementCache,
LRUCache | public class LRUCache (Code) | | Simple implementation of a cache, using Least Recently Used algorithm
for discarding members when the cache fills up
|
Constructor Summary | |
public | LRUCache(int maxSize) |
LRUCache | public LRUCache(int maxSize)(Code) | | Constructor
|
LRUSize | public int LRUSize()(Code) | | |
cacheSize | public int cacheSize()(Code) | | |
cleanupAll | public void cleanupAll()(Code) | | |
cleanupObject | protected void cleanupObject(Object o)(Code) | | Override this method to do special cleanup on an object,
such as closing a statement or a connection
|
get | public synchronized Object get(Object key)(Code) | | Gets an object from the cache. This object is set to be the
most recenty used
|
put | public void put(Object key, Object value)(Code) | | Puts a new object in the cache. If the cache is full, it removes
the least recently used object. The new object becomes the most
recently used object.
|
remove | public synchronized Object remove(Object key)(Code) | | Removes the object from the cache and the lru list
|
resize | public void resize(int newSize)(Code) | | Resize the cache
|
|
|