Class HistoricalPriorityQueue<E>

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

    public class HistoricalPriorityQueue<E>
    extends AbstractHistoricalQueue<E,​java.util.PriorityQueue<E>>
    PriorityQueue-valued historical state. The current priority queue is always maintained, and past states of the priority queue 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(), add() and set() methods. Any returned sublist 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 4 feb. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • HistoricalPriorityQueue

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

        public HistoricalPriorityQueue​(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.PriorityQueue<E> get()
        Returns the current queue.
        Returns:
        Queue; current queue
      • get

        public java.util.PriorityQueue<E> get​(Time time)
        Returns a past queue.
        Parameters:
        time - Time; time to obtain the queue at
        Returns:
        Queue; past queue
      • toString

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