com.ctc.wstx.util
Class SimpleCache
java.lang.Object
com.ctc.wstx.util.SimpleCache
public final class SimpleCache
- extends Object
Simple Map implementation usable for caches where contents do not
expire, but where size needs to remain bounded.
Note: we probably should use weak references, or something similar
to limit maximum memory usage. This could be implemented in many
ways, perhaps by using two areas: first, smaller one, with strong
refs, and secondary bigger one that uses soft references.
Field Summary |
protected com.ctc.wstx.util.SimpleCache.LimitMap |
mItems
|
protected int |
mMaxSize
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mItems
protected final com.ctc.wstx.util.SimpleCache.LimitMap mItems
mMaxSize
protected final int mMaxSize
SimpleCache
public SimpleCache(int maxSize)
find
public Object find(Object key)
add
public void add(Object key,
Object value)