K - 键类型V - 值类型public class LRUCache<K,V> extends ReentrantCache<K,V>
lockcacheMap, capacity, existCustomTimeout, hitCount, keyLockMap, listener, missCount, timeout| 限定符和类型 | 方法和说明 |
|---|---|
protected int |
pruneCache()
只清理超时对象,LRU的实现会交给
LinkedHashMap |
cacheObjIterator, clear, containsKey, get, prune, put, remove, toStringcacheObjIter, capacity, get, get, getHitCount, getMissCount, getWithoutLock, isEmpty, isFull, isPruneExpiredActive, iterator, keySet, onRemove, put, putWithoutLock, removeWithoutLock, setListener, size, timeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic LRUCache(int capacity)
capacity - 容量public LRUCache(int capacity,
long timeout)
capacity - 容量timeout - 默认超时时间,单位:毫秒protected int pruneCache()
LinkedHashMappruneCache 在类中 AbstractCache<K,V>Copyright © 2024. All rights reserved.