Class LRUCache<K,​V>

  • Type Parameters:
    K - Type of the keys
    V - Type of the values
    All Implemented Interfaces:
    Serializable, Cloneable, Map<K,​V>

    @API(status=INTERNAL,
         since="2021.0.2")
    public final class LRUCache<K,​V>
    extends LinkedHashMap<K,​V>
    A non thread safe least recently used (LRU) cache. It must be used with a locking implementation around it.
    Since:
    2021.0.2
    Author:
    Michael J. Simons
    See Also:
    Serialized Form
    • Constructor Detail

      • LRUCache

        public LRUCache​(int cacheSize)
        Creates a new LRU cache with the given cache size
        Parameters:
        cacheSize - The number of entries to keep around.