public class LRUCache
extends com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
LRU (Least Recently Used) algorithm for the cache.
Implementation based on theLRUCache
class.com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.Entry, com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.HashIterator, com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.KeyIterator, com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.ValueIterator
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
barrierLock, count, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_MAX_ENTRIES, entrySet, groups, keySet, lastWrite, loadFactor, maxEntries, memoryCaching, NULL, persistenceListener, table, threshold, UNLIMITED, unlimitedDiskCache, values
Constructor and Description |
---|
LRUCache()
Constructs an LRU Cache.
|
LRUCache(int capacity)
Constructors a LRU Cache of the specified capacity.
|
Modifier and Type | Method and Description |
---|---|
protected void |
itemPut(Object key)
An object was put in the cache.
|
protected void |
itemRemoved(Object key)
Remove specified key since that object has been removed from the cache.
|
protected void |
itemRetrieved(Object key)
An item was retrieved from the list.
|
protected Object |
removeItem()
An item needs to be removed from the cache.
|
capacity, clear, clone, contains, containsKey, containsValue, elements, entrySet, findAndRemoveEntry, get, getGroup, getGroupForReading, getGroupsForReading, getMaxEntries, getPersistenceListener, getTableForReading, isEmpty, isMemoryCaching, isOverflowPersistence, isUnlimitedDiskCache, keys, keySet, loadFactor, persistClear, persistRemove, persistRemoveGroup, persistRetrieve, persistRetrieveGroup, persistStore, persistStoreGroup, put, putAll, recordModification, rehash, remove, removeForce, setMaxEntries, setMemoryCaching, setOverflowPersistence, setPersistenceListener, setUnlimitedDiskCache, size, sput, sremove, values
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public LRUCache()
public LRUCache(int capacity)
capacity
- The maximum cache capacity.protected void itemRetrieved(Object key)
itemRetrieved
in class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
key
- The cache key of the item that was retrieved.protected void itemPut(Object key)
itemPut
in class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
key
- The cache key of the item that was put.protected Object removeItem()
removeItem
in class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
protected void itemRemoved(Object key)
itemRemoved
in class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
key
- The cache key of the item that was removed.LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.