|
xmlgraphics-commons 1.3.1 | ||||||||||
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
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. |
java.lang.Object |
get(java.lang.Object key)
Returns the value associated with the given key. |
void |
put(java.lang.Object key,
java.lang.Object value)
Put a new value in the cache overwriting any existing value with the same key. |
java.lang.Object |
remove(java.lang.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 synchronizedMethod Detail |
public java.lang.Object get(java.lang.Object key)
key
- the key
public java.lang.Object remove(java.lang.Object key)
key
- the key
public void put(java.lang.Object key, java.lang.Object value)
key
- The keyvalue
- the valuepublic void clear()
public void doHouseKeeping()
|
xmlgraphics-commons 1.3.1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |