Class MaxSizeLinkedHashMap<K,​V>

    • Constructor Detail

      • MaxSizeLinkedHashMap

        public MaxSizeLinkedHashMap​(int maxSize)
        Constructs a MaxSizeLinkedHashMap with maximum size maxSize.
        Parameters:
        maxSize - The maximum size for this MaxSizeLinkedHashMap.
        Throws:
        IllegalArgumentException - if maxSize is not positive.
    • Method Detail

      • removeEldestEntry

        protected boolean removeEldestEntry​(Map.Entry<K,​V> eldest)

        This implementation will return true if this MaxSizeLinkedHashMap has reached its maximum size, else false.

        Overrides:
        removeEldestEntry in class LinkedHashMap<K,​V>