MemoryCache

interface MemoryCache

An LRU cache of Images.

Types

Link copied to clipboard
class Builder
Link copied to clipboard
class Key @JvmOverloads constructor(val key: String, extras: Map<String, String> = emptyMap())

The cache key for a Value in the memory cache.

Link copied to clipboard
class Value @JvmOverloads constructor(val image: Image, extras: Map<String, Any> = emptyMap())

The value for an Image in the memory cache.

Properties

Link copied to clipboard
abstract val keys: Set<MemoryCache.Key>

The keys present in the cache.

Link copied to clipboard
abstract val maxSize: Long

The maximum size of the cache in bytes.

Link copied to clipboard
abstract val size: Long

The current size of the cache in bytes.

Functions

Link copied to clipboard
abstract fun clear()

Remove all values from the memory cache.

Link copied to clipboard
abstract operator fun get(key: MemoryCache.Key): MemoryCache.Value?

Get the Value associated with key.

Link copied to clipboard
abstract fun remove(key: MemoryCache.Key): Boolean

Remove the Value referenced by key.

Link copied to clipboard
abstract operator fun set(key: MemoryCache.Key, value: MemoryCache.Value)

Set the Value associated with key.

Link copied to clipboard
abstract fun trimToSize(size: Long)

Remove the eldest entries until the cache's size is at or below size.