public final class SimpleCache<K,V>
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SimpleCache.LimitMap<K,V> |
Modifier and Type | Field and Description |
---|---|
(package private) SimpleCache.LimitMap<K,V> |
mItems |
(package private) int |
mMaxSize |
Constructor and Description |
---|
SimpleCache(int maxSize) |
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value) |
V |
find(K key) |