Class AccessBasedLRUCache<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values
    All Implemented Interfaces:
    Serializable, Cloneable, Map<K,​V>

    public class AccessBasedLRUCache<K,​V>
    extends LinkedHashMap<K,​V>
    A Map acting like a LRU cache which will evict elements which have not been accessed in a while.
    See Also:
    Serialized Form
    • Constructor Detail

      • AccessBasedLRUCache

        public AccessBasedLRUCache​(int maxSize,
                                   int initialCapacity,
                                   float loadFactor)
        Create a new cache.
        Parameters:
        maxSize - the maximum size of the cache before it starts evicting elements.
        initialCapacity - pre-allocated capacity for the cache.
        loadFactor - the load factor