类 ConcurrentLruCache<K,V>
java.lang.Object
com.alibaba.druid.util.ConcurrentLruCache<K,V>
Simple LRU (Least Recently Used) cache, bounded by a specified cache capacity.
This is a simplified, opinionated implementation of an LRU cache
It is inspired from
ConcurrentLruCache.
-
构造器详细资料
-
ConcurrentLruCache
public ConcurrentLruCache(int capacity)
-
-
方法详细资料
-
get
-
computeIfAbsent
-
forEach
-
keys
-
size
public int size() -
clear
public void clear() -
contains
Determine whether the given key is present in this cache.- 参数:
key- the key to check for- 返回:
trueif the key is present,falseif there was no matching key
-
remove
Immediately remove the given key and any associated value.- 参数:
key- the key to evict the entry for- 返回:
trueif the key was present before,falseif there was no matching key
-