MemoryCache

interface MemoryCache

An LRU cache of Bitmaps.

Types

Builder
Link copied to clipboard
class Builder(context: Context)
Key
Link copied to clipboard
class Key(key: String, extras: Map<String, String>) : Parcelable
The cache key for a Bitmap in the memory cache.
Value
Link copied to clipboard
class Value(bitmap: Bitmap, extras: Map<String, Any>)
The value for a Bitmap in the memory cache.

Functions

clear
Link copied to clipboard
abstract fun clear()
Remove all values from the memory cache.
get
Link copied to clipboard
abstract operator fun get(key: MemoryCache.Key): MemoryCache.Value?
Get the Value associated with key.
remove
Link copied to clipboard
abstract fun remove(key: MemoryCache.Key): Boolean
Remove the Value referenced by key.
set
Link copied to clipboard
abstract operator fun set(key: MemoryCache.Key, value: MemoryCache.Value)
Set the Value associated with key.
trimMemory
Link copied to clipboard
abstract fun trimMemory(level: Int)

Properties

keys
Link copied to clipboard
abstract val keys: Set<MemoryCache.Key>
The keys present in the cache.
maxSize
Link copied to clipboard
abstract val maxSize: Int
The maximum size of the cache in bytes.
size
Link copied to clipboard
abstract val size: Int
The current size of the cache in bytes.