程序包 cn.zhxu.bs.util
类 LRUCache<T>
- 类型参数:
T- 泛型
- 所有已实现的接口:
Cache<T>,Serializable,Cloneable,Map<String,T>
LRU 缓存
- 从以下版本开始:
- v3.5.0
- 作者:
- Troy.Zhou @ 2022-02-22
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void投放缓存获取缓存intprotected booleanremoveEldestEntry(Map.Entry eldest) voidsetMaxCacheCount(int maxCacheCount) 从类继承的方法 java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values从类继承的方法 java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size从类继承的方法 java.util.AbstractMap
equals, hashCode, toString从接口继承的方法 java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
构造器详细资料
-
LRUCache
public LRUCache(int maxCacheCount)
-
-
方法详细资料
-
get
从接口复制的说明:Cache获取缓存 -
cache
从接口复制的说明:Cache投放缓存 -
removeEldestEntry
- 覆盖:
removeEldestEntry在类中LinkedHashMap<String,T>
-
getMaxCacheCount
public int getMaxCacheCount() -
setMaxCacheCount
public void setMaxCacheCount(int maxCacheCount)
-