Class AbstractHistoricalList<E,L extends List<E>>
java.lang.Object
org.opentrafficsim.core.perception.AbstractHistorical<E,AbstractHistoricalCollection.EventCollection<E,C>>
org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection<E,L>
org.opentrafficsim.core.perception.collections.AbstractHistoricalList<E,L>
- Type Parameters:
E- element typeL- list type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,HistoricalCollection<E>,HistoricalList<E>,HistoryManager.HistoricalElement
- Direct Known Subclasses:
HistoricalArrayList,HistoricalLinkedList,HistoricalVector
public abstract class AbstractHistoricalList<E,L extends List<E>> extends AbstractHistoricalCollection<E,L> implements HistoricalList<E>
List-valued historical state. The current list is always maintained, and past states of the list are obtained by applying the
events between now and the requested time in reverse.
The
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 2 jan. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractHistoricalList.AddEvent<E,L extends List<E>>Class for events that add a value to the list.static classAbstractHistoricalList.EventList<E,L extends List<E>>Abstract super class for events that add or remove a value from the list.static classAbstractHistoricalList.RemoveEvent<E,L extends List<E>>Class for events that remove a value from the list.Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection
AbstractHistoricalCollection.EventCollection<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 protectedAbstractHistoricalList(HistoryManager historyManager, L list)Constructor. -
Method Summary
Modifier and Type Method Description voidadd(int index, E value)booleanadd(E value)booleanaddAll(int index, Collection<? extends E> c)Eget(int index)intindexOf(Object o)intlastIndexOf(Object o)ListIterator<E>listIterator()ListIterator<E>listIterator(int index)Eremove(int index)booleanremove(Object value)Eset(int index, E value)List<E>subList(int fromIndex, int toIndex)Methods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalCollection
addAll, clear, contains, containsAll, fill, fill, getCollection, isEmpty, iterator, removeAll, retainAll, size, toArray, toArrayMethods inherited from class org.opentrafficsim.core.perception.AbstractHistorical
addEvent, cleanUpHistory, getEvent, getEvents, getLastEvent, isLastState, now, removeEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalCollection
removeIfMethods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalList
get, get, replaceAll, sort
-
Constructor Details
-
AbstractHistoricalList
Constructor.- Parameters:
historyManager- HistoryManager; history managerlist- L; initial list
-
-
Method Details
-
add
-
add
-
remove
-
remove
-
set
-
addAll
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
listIterator
- Specified by:
listIteratorin interfaceList<E>
-
subList
-