Class HistoricalVector<E>

Type Parameters:
E - element type
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, HistoricalCollection<E>, HistoricalList<E>, HistoryManager.HistoricalElement

public class HistoricalVector<E>
extends AbstractHistoricalList<E,​Vector<E>>
Vector-valued historical state. The current vector is always maintained, and past states of the vector are obtained by applying the events between now and the requested time in reverse.

This class does not implement all Vector methods, but only those shared with List. The returned argument is however a List.

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

    • HistoricalVector

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

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

    • get

      public Vector<E> get()
      Returns the current list.
      Returns:
      List; current list
    • get

      public Vector<E> get​(Time time)
      Returns a past list.
      Parameters:
      time - Time; time to obtain the list at
      Returns:
      List; past list
    • toString

      public String toString()
      Overrides:
      toString in class Object