public class LruMemoryCache extends java.lang.Object implements MemoryCache
Constructor and Description |
---|
LruMemoryCache(int maxSize) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all items from cache
|
android.graphics.Bitmap |
get(java.lang.String key)
Returns the Bitmap for
key if it exists in the cache. |
java.util.Collection<java.lang.String> |
keys()
Returns all keys of cache
|
boolean |
put(java.lang.String key,
android.graphics.Bitmap value)
Caches
Bitmap for key . |
android.graphics.Bitmap |
remove(java.lang.String key)
Removes the entry for
key if it exists. |
java.lang.String |
toString() |
public LruMemoryCache(int maxSize)
maxSize
- Maximum sum of the sizes of the Bitmaps in this cachepublic final android.graphics.Bitmap get(java.lang.String key)
key
if it exists in the cache. If a Bitmap was returned, it is moved to the head
of the queue. This returns null if a Bitmap is not cached.get
in interface MemoryCache
public final boolean put(java.lang.String key, android.graphics.Bitmap value)
Bitmap
for key
. The Bitmap is moved to the head of the queue.put
in interface MemoryCache
public final android.graphics.Bitmap remove(java.lang.String key)
key
if it exists.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
public final java.lang.String toString()
toString
in class java.lang.Object