|
xmlgraphics-commons 2.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xmlgraphics.image.loader.util.SoftMapCache
public class SoftMapCache
Provides a simple cache using soft references and storing the values in a Map. The keys into the Map are hard references, the values are referenced through soft references. The collected values are cleaned up through a ReferenceQueue.
| Constructor Summary | |
|---|---|
SoftMapCache(boolean synched)
Creates a new soft cache. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the cache. |
void |
doHouseKeeping()
Triggers some house-keeping, i.e. |
Object |
get(Object key)
Returns the value associated with the given key. |
void |
put(Object key,
Object value)
Put a new value in the cache overwriting any existing value with the same key. |
Object |
remove(Object key)
Removed the value associated with the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SoftMapCache(boolean synched)
synched - true if the Map containing the values should by synchronized| Method Detail |
|---|
public Object get(Object key)
key - the key
public Object remove(Object key)
key - the key
public void put(Object key,
Object value)
key - The keyvalue - the valuepublic void clear()
public void doHouseKeeping()
|
xmlgraphics-commons 2.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||