|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.util.Cache
A pre jdk1.4 replacement for LinkedHashMap which is basically a cache.
Nested Class Summary | |
(package private) class |
Cache.CacheEntryImpl
|
Constructor Summary | |
Cache(long maxSize,
CacheEntryListener listener)
Creates a cache whih will keep at most maxSize purgeable entries. |
Method Summary | |
void |
clear()
Empties the cache completely. |
Object |
get(Object key)
Return the value, if any associated with the given key. |
CacheEntry |
getCacheEntry(Object key)
Return the cache entry, if any, associated with the given key. |
void |
purge(int fraction)
Purges some of the cache. |
Object |
put(Object key,
Object value)
Create a cache entry to hold the given value, and insert it. |
protected CacheEntry |
putCacheEntry(Object key,
CacheEntry value)
Inserts the given cache entry directly. |
Object |
remove(Object key)
Remove the value, if any, and cacheEntry associated with the given key. |
protected CacheEntry |
removeCacheEntry(Object key)
Remove the value, if any, and cacheEntry associated with the given key. |
void |
sticky(Object key,
boolean sticky)
Force the value associated with the given key to be purgeable or non-purgeable from the cache (non-sticky vs. sticky). |
void |
stickyCacheEntry(CacheEntry ce,
boolean sticky)
Change the purgeability of the given cacheEntry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Cache(long maxSize, CacheEntryListener listener)
Method Detail |
public void clear()
public void purge(int fraction)
protected CacheEntry putCacheEntry(Object key, CacheEntry value)
public Object put(Object key, Object value)
protected CacheEntry removeCacheEntry(Object key)
public Object remove(Object key)
public CacheEntry getCacheEntry(Object key)
public Object get(Object key)
public void stickyCacheEntry(CacheEntry ce, boolean sticky)
public void sticky(Object key, boolean sticky)
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |