Cache

class Cache<K, V>(creator: (K) -> V)(source)

A simple thread-safe cache of objects.

Parameters

K

the type of keys

V

the type of values

Constructors

Link copied to clipboard
fun <K, V> Cache(creator: (K) -> V)

Functions

Link copied to clipboard
@Synchronized
fun clear()

Removes all keys and values from the cache.

Link copied to clipboard
@Synchronized
fun get(key: K, useCache: Boolean = true): V

Returns the value that corresponds to key.