|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.netseeker.ejoe.cache.SoftKeyedObjectCache
A keyed value cache implementation that uses soft references to store cached values. Once a value got garbage collected by the JVM, the associated key-value pair will be removed by the next put() or get() operation.
| Constructor Summary | |
SoftKeyedObjectCache()
Create a new cache which will store max. 10000 objects. |
|
SoftKeyedObjectCache(int size)
Create a new cache of the given size. |
|
| Method Summary | |
java.lang.Object |
get(java.lang.Object key)
Returns an entry from this cache |
void |
put(java.lang.Object key,
java.lang.Object obj)
Adds a new entry to this cache under the given key |
java.lang.Object |
remove(java.lang.Object key)
Removes the given key and it's associated value from this cache |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SoftKeyedObjectCache()
public SoftKeyedObjectCache(int size)
size - max. amount of objects to hold in this cache| Method Detail |
public void put(java.lang.Object key,
java.lang.Object obj)
key - identifier under which the given object will be found in this
cacheobj - object to cachepublic java.lang.Object get(java.lang.Object key)
key -
public java.lang.Object remove(java.lang.Object key)
key -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||