LruCache

Class of android.util · LruCache.java · Android's reference

public class LruCache<K, V>

A cache that holds at most maxSize of values, as sizeOf measures them. A get moves its value to the head of the queue, and when the cache is full the value at the tail is evicted.

Constructors

public LruCache(int maxSize) source

Methods

public void resize(int maxSize) source
public final V get(K key) source
public final V put(K key, V value) source
public void trimToSize(int maxSize) source
public final V remove(K key) source
protected void entryRemoved(boolean evicted, K key, V oldValue, V newValue) empty body source
protected V create(K key) source
protected int sizeOf(K key, V value) source
public final void evictAll() source
public final synchronized int size() source
public final synchronized int maxSize() source
public final synchronized int hitCount() source
public final synchronized int missCount() source
public final synchronized int createCount() source
public final synchronized int putCount() source
public final synchronized int evictionCount() source
public final synchronized Map<K, V> snapshot() source
public final synchronized String toString() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.