T - 泛型public class LRUCache<T> extends LinkedHashMap<String,T> implements Cache<T>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 构造器和说明 |
|---|
LRUCache(int maxCacheCount) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cache(String key,
T value)
投放缓存
|
T |
get(String key)
获取缓存
|
int |
getMaxCacheCount() |
protected boolean |
removeEldestEntry(Map.Entry eldest) |
void |
setMaxCacheCount(int maxCacheCount) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeprotected boolean removeEldestEntry(Map.Entry eldest)
removeEldestEntry 在类中 LinkedHashMap<String,T>public int getMaxCacheCount()
public void setMaxCacheCount(int maxCacheCount)
Copyright © 2024. All rights reserved.