public class LRULimitedMemoryCache extends LimitedMemoryCache
bitmap cache. Provides bitmaps storing. Size of all stored bitmaps will not to
exceed size limit. When cache reaches limit size then the least recently used bitmap is deleted from cache.| Constructor and Description |
|---|
LRULimitedMemoryCache(int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all items from cache
|
protected java.lang.ref.Reference<android.graphics.Bitmap> |
createReference(android.graphics.Bitmap value)
Creates not strong reference of value
|
android.graphics.Bitmap |
get(java.lang.String key)
Returns value by key.
|
protected int |
getSize(android.graphics.Bitmap value) |
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
|
protected android.graphics.Bitmap |
removeNext() |
getSizeLimitkeyspublic LRULimitedMemoryCache(int maxSize)
maxSize - Maximum sum of the sizes of the Bitmaps in this cachepublic boolean put(java.lang.String key,
android.graphics.Bitmap value)
MemoryCacheput in interface MemoryCacheput in class LimitedMemoryCachepublic android.graphics.Bitmap get(java.lang.String key)
MemoryCacheget in interface MemoryCacheget in class BaseMemoryCachepublic android.graphics.Bitmap remove(java.lang.String key)
MemoryCacheremove in interface MemoryCacheremove in class LimitedMemoryCachepublic void clear()
MemoryCacheclear in interface MemoryCacheclear in class LimitedMemoryCacheprotected int getSize(android.graphics.Bitmap value)
getSize in class LimitedMemoryCacheprotected android.graphics.Bitmap removeNext()
removeNext in class LimitedMemoryCacheprotected java.lang.ref.Reference<android.graphics.Bitmap> createReference(android.graphics.Bitmap value)
BaseMemoryCachecreateReference in class BaseMemoryCache