Constructor and Description |
---|
LruCache(android.content.Context context)
Create a cache using an appropriate portion of the available RAM as the maximum size.
|
LruCache(int maxByteCount)
Create a cache with a given maximum size in bytes.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache.
|
void |
clearKeyUri(java.lang.String uri)
Remove items whose key is prefixed with
keyPrefix . |
int |
evictionCount()
Returns the number of values that have been evicted.
|
android.graphics.Bitmap |
get(java.lang.String key)
Retrieve an image for the specified
key or null . |
int |
hitCount()
Returns the number of times
get(java.lang.String) returned a value. |
int |
maxSize()
Returns the maximum size in bytes that the cache can hold.
|
int |
missCount()
Returns the number of times
get(java.lang.String) returned null . |
int |
putCount()
Returns the number of times
set(String, Bitmap) was called. |
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.
|
public LruCache(android.content.Context context)
public LruCache(int maxByteCount)
public android.graphics.Bitmap get(java.lang.String key)
Cache
key
or null
.public void set(java.lang.String key, android.graphics.Bitmap bitmap)
Cache
key
.public int size()
Cache
public int maxSize()
Cache
public void clear()
Cache
public void clearKeyUri(java.lang.String uri)
Cache
keyPrefix
.clearKeyUri
in interface Cache
public int hitCount()
get(java.lang.String)
returned a value.public int missCount()
get(java.lang.String)
returned null
.public int putCount()
set(String, Bitmap)
was called.public int evictionCount()