K - The key.V - The value.public final class LruCache<K,V> extends Object implements Map<K,V>
This cache is keeps a maximal number of items in memory and removes the least-recently-used item, when new items are added.
| Constructor and Description |
|---|
LruCache(int maxEntries) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
V |
compute(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction) |
V |
computeIfAbsent(K key,
Function<? super K,? extends V> mappingFunction) |
V |
computeIfPresent(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
merge(K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
putIfAbsent(K key,
V value) |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
int |
size() |
Collection<V> |
values() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, forEach, getOrDefault, hashCode, replaceAllpublic final boolean containsKey(Object key)
containsKey in interface Map<K,V>public final boolean containsValue(Object value)
containsValue in interface Map<K,V>public final V putIfAbsent(K key, V value)
putIfAbsent in interface Map<K,V>public final V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
computeIfAbsent in interface Map<K,V>public final V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
computeIfPresent in interface Map<K,V>public final V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Copyright © 2014–2018 XMPP.rocks. All rights reserved.