Class MaxSizeMap<K,​V>

  • Type Parameters:
    K - Key
    V - Value
    All Implemented Interfaces:
    Serializable, Cloneable, Map<K,​V>

    public class MaxSizeMap<K,​V>
    extends LinkedHashMap<K,​V>
    Map that ejects the last recently accessed or inserted element(s) to keep the size to a specified maximum.
    See Also:
    Serialized Form
    • Constructor Detail

      • MaxSizeMap

        public MaxSizeMap​(int maxSize,
                          boolean accessOrder)
        Parameters:
        maxSize - maximum size of the map.
        accessOrder - true for access-order, false for insertion-order.