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 maxSize)
Create a cache with a given maximum size in bytes.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache.
|
void |
clearKeyUri(String uri)
Remove items whose key is prefixed with
keyPrefix . |
void |
evictAll()
Clear the cache.
|
int |
evictionCount()
Returns the number of values that have been evicted.
|
android.graphics.Bitmap |
get(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(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 maxSize)
public android.graphics.Bitmap get(String key)
Cache
key
or null
.public void set(String key, android.graphics.Bitmap bitmap)
Cache
key
.public final void evictAll()
public final int size()
Cache
public final int maxSize()
Cache
public final void clear()
Cache
public final void clearKeyUri(String uri)
Cache
keyPrefix
.clearKeyUri
in interface Cache
public final int hitCount()
get(java.lang.String)
returned a value.public final int missCount()
get(java.lang.String)
returned null
.public final int putCount()
set(String, Bitmap)
was called.public final int evictionCount()
Copyright © 2013-2015 Square, Inc.. All Rights Reserved.