Class LRUMap<K,V>

All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class LRUMap<K,V> extends LinkedHashMap<K,V>
Represents LRU Map implementation based on LinkedHashMap.
Version:
1.0
Author:
Fyodor Kupolov
See Also:
  • Constructor Details

    • LRUMap

      public LRUMap(int size)
  • Method Details

    • removeEldestEntry

      protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
      Overrides:
      removeEldestEntry in class LinkedHashMap<K,V>
    • onEldestEntryRemove

      protected void onEldestEntryRemove(Map.Entry<K,V> eldest)
      Invoked when eldest entry is about to be removed.
      Parameters:
      eldest - eldest entry.