public class LruCache<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
static <K,V> LruCache<K,V> |
create() |
static <K,V> LruCache<K,V> |
create(int maxCapacity) |
V |
get(Object key) |
int |
getMaxCapacity() |
V |
put(K key,
V value) |
V |
remove(Object key) |
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
void |
setMaxCapacity(int maxCapacity) |
int |
size() |
containsValue, entrySet, forEach, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace
public static <K,V> LruCache<K,V> create()
public static <K,V> LruCache<K,V> create(int maxCapacity)
protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class HashMap<K,V>
public int size()
public void clear()
public int getMaxCapacity()
public void setMaxCapacity(int maxCapacity)
Copyright © 2024. All rights reserved.