Package com.ctc.wstx.util
Class SimpleCache<K,V>
- java.lang.Object
-
- com.ctc.wstx.util.SimpleCache<K,V>
-
public final class SimpleCache<K,V> extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SimpleCache.LimitMap<K,V>
-
Field Summary
Fields Modifier and Type Field Description (package private) SimpleCache.LimitMap<K,V>
mItems
(package private) int
mMaxSize
-
Constructor Summary
Constructors Constructor Description SimpleCache(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(K key, V value)
V
find(K key)
-