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.
public LruCache(int maxSize) sourcepublic void resize(int maxSize) sourcepublic final V get(K key) sourcepublic final V put(K key, V value) sourcepublic void trimToSize(int maxSize) sourcepublic final V remove(K key) sourceprotected void entryRemoved(boolean evicted, K key, V oldValue, V newValue) empty body sourceprotected V create(K key) sourceprotected int sizeOf(K key, V value) sourcepublic final void evictAll() sourcepublic final synchronized int size() sourcepublic final synchronized int maxSize() sourcepublic final synchronized int hitCount() sourcepublic final synchronized int missCount() sourcepublic final synchronized int createCount() sourcepublic final synchronized int putCount() sourcepublic final synchronized int evictionCount() sourcepublic final synchronized Map<K, V> snapshot() sourcepublic final synchronized String toString() sourceMade 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.