Package adams.core

Class LRUCache.LRUCacheLinkedHashMap

    • Constructor Detail

      • LRUCacheLinkedHashMap

        public LRUCacheLinkedHashMap​(int capacity,
                                     float loadFactor)
        the constructor.
        Parameters:
        capacity - the capacity of the cache
        loadFactor - the load factor of the hashtable
    • Method Detail

      • removeEldestEntry

        protected boolean removeEldestEntry​(Map.Entry<K,​V> eldest)
        Returns whether the oldest entry has to be removed.
        Overrides:
        removeEldestEntry in class LinkedHashMap<K,​V>
        Parameters:
        eldest - the entry
        Returns:
        true if the cache is full