Class HistoricalHashSet<E>

  • Type Parameters:
    E - element type
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>, HistoricalCollection<E>, HistoricalSet<E>, HistoryManager.HistoricalElement

    public class HistoricalHashSet<E>
    extends AbstractHistoricalCollection<E,​java.util.LinkedHashSet<E>>
    implements HistoricalSet<E>
    LinkedHashSet-valued historical state. The current hash set is always maintained, and past states of the hash set are obtained by applying the events between now and the requested time in reverse.

    The Iterator returned by this class does not support the remove() method. Any returned subset is 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

      • HistoricalHashSet

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

        public HistoricalHashSet​(HistoryManager historyManager,
                                 java.util.Collection<? extends E> c)
        Constructor.
        Parameters:
        historyManager - HistoryManager; history manager
        c - Collection<? extends E>; initial collection
    • Method Detail

      • get

        public java.util.LinkedHashSet<E> get​(Time time)
        Returns a past set.
        Specified by:
        get in interface HistoricalCollection<E>
        Specified by:
        get in interface HistoricalSet<E>
        Parameters:
        time - Time; time to obtain the set at
        Returns:
        Set; past set
      • toString

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