Class MaxSizeMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
org.alfresco.util.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:
  • Constructor Details

    • MaxSizeMap

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