Class AbstractHistoricalSortedMap<K,​V,​M extends java.util.SortedMap<K,​V>>

  • Type Parameters:
    K - key type
    V - value type
    M - sorted map type
    All Implemented Interfaces:
    java.util.Map<K,​V>, java.util.SortedMap<K,​V>, HistoricalMap<K,​V>, HistoricalSortedMap<K,​V>, HistoryManager.HistoricalElement
    Direct Known Subclasses:
    AbstractHistoricalNavigableMap

    public abstract class AbstractHistoricalSortedMap<K,​V,​M extends java.util.SortedMap<K,​V>>
    extends AbstractHistoricalMap<K,​V,​M>
    implements HistoricalSortedMap<K,​V>
    SortedMap-valued historical state. The current sorted map is always maintained, and past states of the sorted map are obtained by applying the events between now and the requested time in reverse.

    The set views and sub-maps returned by this class are unmodifiable.

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version 2 feb. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • AbstractHistoricalSortedMap

        protected AbstractHistoricalSortedMap​(HistoryManager historyManager,
                                              M map)
        Constructor.
        Parameters:
        historyManager - HistoryManager; history manager
        map - M; initial map
    • Method Detail

      • comparator

        public java.util.Comparator<? super K> comparator()
        Specified by:
        comparator in interface java.util.SortedMap<K,​V>
      • subMap

        public java.util.SortedMap<K,​V> subMap​(K fromKey,
                                                     K toKey)
        Specified by:
        subMap in interface java.util.SortedMap<K,​V>
      • headMap

        public java.util.SortedMap<K,​V> headMap​(K toKey)
        Specified by:
        headMap in interface java.util.SortedMap<K,​V>
      • tailMap

        public java.util.SortedMap<K,​V> tailMap​(K fromKey)
        Specified by:
        tailMap in interface java.util.SortedMap<K,​V>
      • firstKey

        public K firstKey()
        Specified by:
        firstKey in interface java.util.SortedMap<K,​V>
      • lastKey

        public K lastKey()
        Specified by:
        lastKey in interface java.util.SortedMap<K,​V>