Interface SizedMap

All Superinterfaces:
Map
All Known Implementing Classes:
ConcurrentHashMap, ConcurrentReferenceHashMap, LRUMap, ReferenceHashMap

public interface SizedMap extends Map
A Map type that maintains a maximum size, automatically removing entries when the maximum is exceeded.
Author:
Abe White
  • Method Details

    • getMaxSize

      int getMaxSize()
      The maximum number of entries, or Integer.MAX_VALUE for no limit.
    • setMaxSize

      void setMaxSize(int max)
      The maximum number of entries, or Integer.MAX_VALUE for no limit.
    • isFull

      boolean isFull()
      Whether the map is full.
    • overflowRemoved

      void overflowRemoved(Object key, Object value)
      Overridable callback for when an overflow entry is automatically removed.