Class LRUCache
java.lang.Object
NetStrategies.CacheStrategy
NetStrategies.CacheStrategies.LRUCache
- All Implemented Interfaces:
AutoCheck
- Direct Known Subclasses:
HLRUCache
LRU (Least Recently Used) cache eviction strategy: removes the item with the smallest timestamp of last access.
-
Field Summary
Fields inherited from class CacheStrategy
engine, netSystem, removeItemMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRemoveItem(LinkedList<CacheItem> caches) Cache item linked list has an access time list which record each request timestamp.Methods inherited from class CacheStrategy
check, getRemoveItemMode, setNetSystem, setRandomEngine, setRemoveItemMode
-
Constructor Details
-
LRUCache
public LRUCache()
-
-
Method Details
-
getRemoveItem
Cache item linked list has an access time list which record each request timestamp. For LRU (Least Recent Used) is to find the cache item that has the smallest timestamp for last access.- Specified by:
getRemoveItemin classCacheStrategy- Parameters:
caches- the list of the cached items.- Returns:
-