public class EntityLruCache<V> extends LinkedHashMap<String,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
EntityLruCache(int maxSize,
long maxObjCacheTime,
TimeUnit maxObjCacheTimeUnit) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all (key, value) pairs from the cache.
|
boolean |
containsKey(Object key) |
V |
get(Object key)
Get the value for the key if it exists in the cache.
|
double |
getHitRatio() |
V |
put(String key,
V value)
Add the (key, value) pair to the cache if there is enough space.
|
protected boolean |
removeEldestEntry(Map.Entry<String,V> eldest) |
int |
size() |
containsValue, entrySet, forEach, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replaceequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replacepublic EntityLruCache(int maxSize,
long maxObjCacheTime,
TimeUnit maxObjCacheTimeUnit)
public double getHitRatio()
public void clear()
public V put(String key, V value)
public boolean containsKey(Object key)
containsKey in interface Map<String,V>containsKey in class HashMap<String,V>public V get(Object key)
public int size()
protected boolean removeEldestEntry(Map.Entry<String,V> eldest)
removeEldestEntry in class LinkedHashMap<String,V>Copyright © 2018. All rights reserved.