Class AbstractHistoricalNavigableSet<E,S extends NavigableSet<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,S>
-
- Type Parameters:
E
- element typeS
- navigable set type
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,NavigableSet<E>
,Set<E>
,SortedSet<E>
,HistoricalCollection<E>
,HistoricalNavigableSet<E>
,HistoricalSet<E>
,HistoricalSortedSet<E>
,HistoryManager.HistoricalElement
- Direct Known Subclasses:
HistoricalTreeSet
public abstract class AbstractHistoricalNavigableSet<E,S extends NavigableSet<E>> extends AbstractHistoricalSortedSet<E,S> implements HistoricalNavigableSet<E>
NavigableSet-valued historical state. The current navigable set is always maintained, and past states of the navigable set are obtained by applying the events between now and the requested time in reverse.
TheIterator
returned by this class does not support theremove()
method. Any returned subset is unmodifiable.Copyright (c) 2013-2022 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 2 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 Collection<E>>, AbstractHistoricalCollection.EventCollection<E,C extends Collection<E>>, AbstractHistoricalCollection.RemoveEvent<E,C extends Collection<E>>
-
Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.AbstractHistorical
AbstractHistorical.EventValue<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractHistoricalNavigableSet(HistoryManager historyManager, S set)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
ceiling(E e)
Iterator<E>
descendingIterator()
NavigableSet<E>
descendingSet()
E
floor(E e)
NavigableSet<E>
headSet(E toElement, boolean inclusive)
E
higher(E e)
E
lower(E e)
E
pollFirst()
E
pollLast()
NavigableSet<E>
subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
NavigableSet<E>
tailSet(E fromElement, boolean inclusive)
String
toString()
-
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 java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalCollection
removeIf
-
Methods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalNavigableSet
get, get
-
Methods inherited from interface java.util.NavigableSet
headSet, iterator, subSet, tailSet
-
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
comparator, first, last, spliterator
-
-
-
-
Constructor Detail
-
AbstractHistoricalNavigableSet
protected AbstractHistoricalNavigableSet(HistoryManager historyManager, S set)
Constructor.- Parameters:
historyManager
- HistoryManager; history managerset
- S; initial set
-
-
Method Detail
-
pollFirst
public E pollFirst()
- Specified by:
pollFirst
in interfaceNavigableSet<E>
-
pollLast
public E pollLast()
- Specified by:
pollLast
in interfaceNavigableSet<E>
-
lower
public E lower(E e)
- Specified by:
lower
in interfaceNavigableSet<E>
-
floor
public E floor(E e)
- Specified by:
floor
in interfaceNavigableSet<E>
-
ceiling
public E ceiling(E e)
- Specified by:
ceiling
in interfaceNavigableSet<E>
-
higher
public E higher(E e)
- Specified by:
higher
in interfaceNavigableSet<E>
-
descendingSet
public NavigableSet<E> descendingSet()
- Specified by:
descendingSet
in interfaceNavigableSet<E>
-
descendingIterator
public Iterator<E> descendingIterator()
- Specified by:
descendingIterator
in interfaceNavigableSet<E>
-
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSet
in interfaceNavigableSet<E>
-
headSet
public NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSet
in interfaceNavigableSet<E>
-
tailSet
public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
- Specified by:
tailSet
in interfaceNavigableSet<E>
-
-