Class HistoricalTreeMap<K,​V>

  • Type Parameters:
    K - key type
    V - value type
    All Implemented Interfaces:
    java.util.Map<K,​V>, java.util.NavigableMap<K,​V>, java.util.SortedMap<K,​V>, HistoricalMap<K,​V>, HistoricalNavigableMap<K,​V>, HistoricalSortedMap<K,​V>, HistoryManager.HistoricalElement

    public class HistoricalTreeMap<K,​V>
    extends AbstractHistoricalNavigableMap<K,​V,​java.util.TreeMap<K,​V>>
    TreeMap-valued historical state. The current tree map is always maintained, and past states of the tree map are obtained by applying the events between now and the requested time in reverse.

    The set views 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 3 feb. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • HistoricalTreeMap

        public HistoricalTreeMap​(HistoryManager historyManager)
        Constructor.
        Parameters:
        historyManager - HistoryManager; history manager
      • HistoricalTreeMap

        public HistoricalTreeMap​(HistoryManager historyManager,
                                 java.util.Map<? extends K,​? extends V> m)
        Constructor.
        Parameters:
        historyManager - HistoryManager; history manager
        m - Map<? extends K, ? extends V>; initial map
    • Method Detail

      • get

        public java.util.TreeMap<K,​V> get()
        Returns the current navigable map.
        Returns:
        NavigableMap; current navigable map
      • get

        public java.util.TreeMap<K,​V> get​(Time time)
        Returns a past navigable map.
        Parameters:
        time - Time; time to obtain the navigable map at
        Returns:
        NavigableMap; past navigable map
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object