Class AbstractHistoricalSortedMap<K,V,M extends SortedMap<K,V>>
- java.lang.Object
-
- org.opentrafficsim.core.perception.AbstractHistorical<K,AbstractHistoricalMap.EventMap<K,V,M>>
-
- org.opentrafficsim.core.perception.collections.AbstractHistoricalMap<K,V,M>
-
- org.opentrafficsim.core.perception.collections.AbstractHistoricalSortedMap<K,V,M>
-
- Type Parameters:
K
- key typeV
- value typeM
- sorted map type
- All Implemented Interfaces:
Map<K,V>
,SortedMap<K,V>
,HistoricalMap<K,V>
,HistoricalSortedMap<K,V>
,HistoryManager.HistoricalElement
- Direct Known Subclasses:
AbstractHistoricalNavigableMap
public abstract class AbstractHistoricalSortedMap<K,V,M extends SortedMap<K,V>> extends AbstractHistoricalMap<K,V,M> implements HistoricalSortedMap<K,V>
SortedMap-valued historical state. The current sorted map is always maintained, and past states of the sorted map are obtained by applying the events between now and the requested time in reverse.
The set views and sub-maps returned by this class are 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.AbstractHistoricalMap
AbstractHistoricalMap.EventMap<K,V,M extends Map<K,V>>
-
Nested classes/interfaces inherited from class org.opentrafficsim.core.perception.AbstractHistorical
AbstractHistorical.EventValue<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractHistoricalSortedMap(HistoryManager historyManager, M map)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparator<? super K>
comparator()
K
firstKey()
SortedMap<K,V>
headMap(K toKey)
K
lastKey()
SortedMap<K,V>
subMap(K fromKey, K toKey)
SortedMap<K,V>
tailMap(K fromKey)
-
Methods inherited from class org.opentrafficsim.core.perception.collections.AbstractHistoricalMap
clear, containsKey, containsValue, entrySet, fill, fill, get, getMap, isEmpty, keySet, put, putAll, remove, size, values
-
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 org.opentrafficsim.core.perception.collections.HistoricalMap
replaceAll
-
Methods inherited from interface org.opentrafficsim.core.perception.collections.HistoricalSortedMap
get, get
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Constructor Detail
-
AbstractHistoricalSortedMap
protected AbstractHistoricalSortedMap(HistoryManager historyManager, M map)
Constructor.- Parameters:
historyManager
- HistoryManager; history managermap
- M; initial map
-
-