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.
TheIterator
returned by this class does not support theremove()
,add()
andset()
methods. Any returned sublist 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 jan. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractHistoricalList.AddEvent<E,L extends List<E>>
Class for events that add a value to the list.static class
AbstractHistoricalList.EventList<E,L extends List<E>>
Abstract super class for events that add or remove a value from the list.static class
AbstractHistoricalList.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 protected
AbstractHistoricalList(HistoryManager historyManager, L list)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, E value)
boolean
add(E value)
boolean
addAll(int index, Collection<? extends E> c)
E
get(int index)
int
indexOf(Object o)
int
lastIndexOf(Object o)
ListIterator<E>
listIterator()
ListIterator<E>
listIterator(int index)
E
remove(int index)
boolean
remove(Object value)
E
set(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, 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, toString, 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.HistoricalList
get, get, replaceAll, sort
-
-
-
-
Constructor Detail
-
AbstractHistoricalList
protected AbstractHistoricalList(HistoryManager historyManager, L list)
Constructor.- Parameters:
historyManager
- HistoryManager; history managerlist
- L; initial list
-
-
Method Detail
-
add
public boolean add(E value)
-
remove
public boolean remove(Object value)
-
addAll
public boolean addAll(int index, Collection<? extends E> c)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<E>
-
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIterator
in interfaceList<E>
-
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIterator
in interfaceList<E>
-
-