Class HistoricalTreeSet<E>
- java.lang.Object
-
- org.opentrafficsim.core.perception.AbstractHistorical<E,AbstractHistoricalCollection.EventCollection<E,C>>
-
- org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection<E,S>
-
- org.opentrafficsim.core.perception.collections.AbstractHistoricalSortedSet<E,S>
-
- org.opentrafficsim.core.perception.collections.AbstractHistoricalNavigableSet<E,java.util.TreeSet<E>>
-
- org.opentrafficsim.core.perception.collections.HistoricalTreeSet<E>
-
- Type Parameters:
E- element type
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.NavigableSet<E>,java.util.Set<E>,java.util.SortedSet<E>,HistoricalCollection<E>,HistoricalNavigableSet<E>,HistoricalSet<E>,HistoricalSortedSet<E>,HistoryManager.HistoricalElement
public class HistoricalTreeSet<E> extends AbstractHistoricalNavigableSet<E,java.util.TreeSet<E>>
TreeSet-valued historical state. The current tree set is always maintained, and past states of the tree set are obtained by applying the events between now and the requested time in reverse.
TheIteratorreturned by this class does not support theremove()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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection
AbstractHistoricalCollection.AddEvent<E,C extends java.util.Collection<E>>, AbstractHistoricalCollection.EventCollection<E,C extends java.util.Collection<E>>, AbstractHistoricalCollection.RemoveEvent<E,C extends java.util.Collection<E>>
-
Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.AbstractHistorical
AbstractHistorical.EventValue<T>
-
-
Constructor Summary
Constructors Constructor Description HistoricalTreeSet(HistoryManager historyManager)Constructor.HistoricalTreeSet(HistoryManager historyManager, java.util.Collection<? extends E> c)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.TreeSet<E>get()Returns the current navigable set.java.util.TreeSet<E>get(Time time)Returns a past navigable set.java.lang.StringtoString()-
Methods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalNavigableSet
ceiling, descendingIterator, descendingSet, floor, headSet, higher, lower, pollFirst, pollLast, subSet, tailSet
-
Methods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalSortedSet
comparator, first, headSet, last, subSet, tailSet
-
Methods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection
add, addAll, clear, contains, containsAll, fill, fill, getCollection, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from class org.opentrafficsim.core.perception.AbstractHistorical
addEvent, cleanUpHistory, getEvent, getEvents, getLastEvent, isLastState, now, removeEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalCollection
removeIf
-
-
-
-
Constructor Detail
-
HistoricalTreeSet
public HistoricalTreeSet(HistoryManager historyManager)
Constructor.- Parameters:
historyManager- HistoryManager; history manager
-
HistoricalTreeSet
public HistoricalTreeSet(HistoryManager historyManager, java.util.Collection<? extends E> c)
Constructor.- Parameters:
historyManager- HistoryManager; history managerc- Collection<? extends E>; initial collection
-
-
Method Detail
-
get
public java.util.TreeSet<E> get()
Returns the current navigable set.- Returns:
- NavigableSet; current navigable set
-
get
public java.util.TreeSet<E> get(Time time)
Returns a past navigable set.- Parameters:
time- Time; time to obtain the navigable set at- Returns:
- NavigableSet; past navigable set
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractHistoricalNavigableSet<E,java.util.TreeSet<E>>
-
-