| |
|
| java.lang.Object jdbm.helper.MRU
MRU | public class MRU implements CachePolicy(Code) | | MRU - Most Recently Used cache policy.
Methods are *not* synchronized, so no concurrent access is allowed.
author: Alex Boisvert version: $Id: MRU.java,v 1.8 2005/06/25 23:12:31 doomdark Exp $ |
Constructor Summary | |
public | MRU(int max) Construct an MRU with a given maximum number of objects. |
_first | CacheEntry _first(Code) | | Beginning of linked-list of cache elements. First entry is element
which has been used least recently.
|
_last | CacheEntry _last(Code) | | End of linked-list of cache elements. Last entry is element
which has been used most recently.
|
_max | int _max(Code) | | Maximum number of objects in the cache.
|
MRU | public MRU(int max)(Code) | | Construct an MRU with a given maximum number of objects.
|
addEntry | protected void addEntry(CacheEntry entry)(Code) | | Add a CacheEntry. Entry goes at the end of the list.
|
addListener | public void addListener(CachePolicyListener listener)(Code) | | Add a listener to this cache policy
Parameters: listener - Listener to add to this policy |
purgeEntry | protected CacheEntry purgeEntry() throws CacheEvictionException(Code) | | Purge least recently used object from the cache
recyclable CacheEntry |
remove | public void remove(Object key)(Code) | | Remove an object from the cache
|
removeAll | public void removeAll()(Code) | | Remove all objects from the cache
|
removeEntry | protected void removeEntry(CacheEntry entry)(Code) | | Remove a CacheEntry from linked list
|
removeListener | public void removeListener(CachePolicyListener listener)(Code) | | Remove a listener from this cache policy
Parameters: listener - Listener to remove from this policy |
touchEntry | protected void touchEntry(CacheEntry entry)(Code) | | Place entry at the end of linked list -- Most Recently Used
|
|
|
|