public interface Cache
Note: The Cache
is accessed by multiple threads. You must ensure
your Cache
implementation is thread safe when get(String)
or set(String, android.graphics.Bitmap)
is called.
Modifier and Type | Field and Description |
---|---|
static Cache |
NONE
A cache which does not store any values.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache.
|
void |
clearKeyUri(java.lang.String keyPrefix)
Remove items whose key is prefixed with
keyPrefix . |
android.graphics.Bitmap |
get(java.lang.String key)
Retrieve an image for the specified
key or null . |
int |
maxSize()
Returns the maximum size in bytes that the cache can hold.
|
void |
set(java.lang.String key,
android.graphics.Bitmap bitmap)
Store an image in the cache for the specified
key . |
int |
size()
Returns the current size of the cache in bytes.
|
static final Cache NONE
android.graphics.Bitmap get(java.lang.String key)
key
or null
.void set(java.lang.String key, android.graphics.Bitmap bitmap)
key
.int size()
int maxSize()
void clear()
void clearKeyUri(java.lang.String keyPrefix)
keyPrefix
.