Class NullHistorical<T>
- java.lang.Object
-
- org.opentrafficsim.core.perception.NullHistorical<T>
-
- Type Parameters:
T- value type
- All Implemented Interfaces:
Historical<T>
public class NullHistorical<T> extends java.lang.Object implements Historical<T>
Simple implementation without history that can be used inside a generic context where also implementations with history can be used.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 1 feb. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description NullHistorical(T value)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Get value at current simulation time.Tget(Time time)Get value at given time.voidset(T value)Set value at the current simulation time.java.lang.StringtoString()
-
-
-
Constructor Detail
-
NullHistorical
public NullHistorical(T value)
Constructor.- Parameters:
value- T; value
-
-
Method Detail
-
set
public void set(T value)
Set value at the current simulation time. If a value is already given at this time, it is overwritten. Values should be set in chronological order.- Specified by:
setin interfaceHistorical<T>- Parameters:
value- T; value
-
get
public T get()
Get value at current simulation time.- Specified by:
getin interfaceHistorical<T>- Returns:
- T; value at current simulation time
-
get
public T get(Time time)
Get value at given time.- Specified by:
getin interfaceHistorical<T>- Parameters:
time- Time; time to get the value- Returns:
- T; value at current time
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-