Class LRUCache<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
org.flag4j.linalg.ops.dispatch.LRUCache<K,V>
Type Parameters:
K - Type of the key in the cache.
V - Type of the value in the cache.
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, SequencedMap<K,V>

public class LRUCache<K,V> extends LinkedHashMap<K,V>
A least recently used (LRU) cache.
See Also:
  • Constructor Details

    • LRUCache

      public LRUCache(int capacity)
      Creates an LRU cache with the specified capacity. If this capacity is exceeded the lest-recently accessed entry will be removed.
      Parameters:
      capacity - Maximum number of entries the LRUCache can store.
  • Method Details