Class LruCache<K,V>
java.lang.Object
com.sure.tool.cache.LruCache<K,V>
- Type Parameters:
K- 键类型V- 值类型
- All Implemented Interfaces:
Cache<K,V>
-
Constructor Details
-
LruCache
public LruCache(int capacity) 创建 LRU 缓存。- Parameters:
capacity- 容量上限(>0)
-
-
Method Details
-
get
-
put
-
remove
-
clear
-
size
-
containsKey
-
isEmpty
-
getCapacity
public int getCapacity()获取容量上限。- Returns:
- 容量
-