Class HistoryMap<T>

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<Integer,​T>

    public class HistoryMap<T>
    extends HashMap<Integer,​T>
    INTERNAL: Helper class for storing elements up to a certain amount, lower most elements will be removed to ensure a fixed size of the collection.
    Since:
    1.2.5
    See Also:
    Serialized Form
    • Field Detail

      • maxEntries

        protected int maxEntries
      • suppressDuplicates

        protected boolean suppressDuplicates
    • Constructor Detail

      • HistoryMap

        public HistoryMap()
        Default constructor which uses 20 entries as the default history size and does suppress duplicates.
      • HistoryMap

        public HistoryMap​(int maxEntries,
                          boolean suppressDuplicates)
        Constructor which allows to specify number of entries to store and duplicate suppression behaviour.
        Parameters:
        maxEntries - Maxium number of entries to store in the history.
        suppressDuplicates - Should suppress duplicate entries in map.
    • Method Detail

      • getMaxEntries

        public int getMaxEntries()
      • doesSuppressDuplicates

        public boolean doesSuppressDuplicates()
      • add

        public void add​(T obj)
      • removeEntry

        public void removeEntry​(T obj)
      • getEntry

        public T getEntry​(int index)
      • getEntriesReverse

        public Collection getEntriesReverse()