Class LRUCache

java.lang.Object
NetStrategies.CacheStrategy
NetStrategies.CacheStrategies.LRUCache
All Implemented Interfaces:
AutoCheck
Direct Known Subclasses:
HLRUCache

public class LRUCache extends CacheStrategy
LRU (Least Recently Used) cache eviction strategy: removes the item with the smallest timestamp of last access.
  • Constructor Details

    • LRUCache

      public LRUCache()
  • Method Details

    • getRemoveItem

      public CacheItem getRemoveItem(LinkedList<CacheItem> caches)
      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:
      getRemoveItem in class CacheStrategy
      Parameters:
      caches - the list of the cached items.
      Returns: