public class LimitedAgeMemoryCache extends java.lang.Object implements MemoryCache
MemoryCache
. Provides special feature for cache: if some cached object age exceeds defined
value then this object will be removed from cache.MemoryCache
Constructor and Description |
---|
LimitedAgeMemoryCache(MemoryCache cache,
long maxAge) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all items from cache
|
android.graphics.Bitmap |
get(java.lang.String key)
Returns value by key.
|
java.util.Collection<java.lang.String> |
keys()
Returns all keys of cache
|
boolean |
put(java.lang.String key,
android.graphics.Bitmap value)
Puts value into cache by key
|
android.graphics.Bitmap |
remove(java.lang.String key)
Removes item by key
|
public LimitedAgeMemoryCache(MemoryCache cache, long maxAge)
cache
- Wrapped memory cachemaxAge
- Max object age (in seconds). If object age will exceed this value then it'll be removed from
cache on next treatment (and therefore be reloaded).public boolean put(java.lang.String key, android.graphics.Bitmap value)
MemoryCache
put
in interface MemoryCache
public android.graphics.Bitmap get(java.lang.String key)
MemoryCache
get
in interface MemoryCache
public android.graphics.Bitmap remove(java.lang.String key)
MemoryCache
remove
in interface MemoryCache
public java.util.Collection<java.lang.String> keys()
MemoryCache
keys
in interface MemoryCache
public void clear()
MemoryCache
clear
in interface MemoryCache