|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjdbm.helper.MRU
public class MRU
MRU - Most Recently Used cache policy. Methods are *not* synchronized, so no concurrent access is allowed.
| Constructor Summary | |
|---|---|
MRU(int max)
Construct an MRU with a given maximum number of objects. |
|
| Method Summary | |
|---|---|
protected void |
addEntry(jdbm.helper.CacheEntry entry)
Add a CacheEntry. |
void |
addListener(CachePolicyListener listener)
Add a listener to this cache policy |
java.util.Enumeration |
elements()
Enumerate elements' values in the cache |
java.lang.Object |
get(java.lang.Object key)
Obtain an object in the cache |
protected jdbm.helper.CacheEntry |
purgeEntry()
Purge least recently used object from the cache |
void |
put(java.lang.Object key,
java.lang.Object value)
Place an object in the cache. |
void |
remove(java.lang.Object key)
Remove an object from the cache |
void |
removeAll()
Remove all objects from the cache |
protected void |
removeEntry(jdbm.helper.CacheEntry entry)
Remove a CacheEntry from linked list |
void |
removeListener(CachePolicyListener listener)
Remove a listener from this cache policy |
protected void |
touchEntry(jdbm.helper.CacheEntry entry)
Place entry at the end of linked list -- Most Recently Used |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MRU(int max)
| Method Detail |
|---|
public void put(java.lang.Object key,
java.lang.Object value)
throws CacheEvictionException
put in interface CachePolicykey - key for the cached objectvalue - the cached object
CacheEvictionException - propagated if, while evicting objects
to make room for new object, an eviction listener encountered
this problem.public java.lang.Object get(java.lang.Object key)
get in interface CachePolicykey - key the object was cached under
public void remove(java.lang.Object key)
remove in interface CachePolicykey - key the object was stored in the cache under.public void removeAll()
removeAll in interface CachePolicypublic java.util.Enumeration elements()
elements in interface CachePolicypublic void addListener(CachePolicyListener listener)
addListener in interface CachePolicylistener - Listener to add to this policypublic void removeListener(CachePolicyListener listener)
removeListener in interface CachePolicylistener - Listener to remove from this policyprotected void addEntry(jdbm.helper.CacheEntry entry)
protected void removeEntry(jdbm.helper.CacheEntry entry)
protected void touchEntry(jdbm.helper.CacheEntry entry)
protected jdbm.helper.CacheEntry purgeEntry()
throws CacheEvictionException
CacheEvictionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||