Class ExtendedDataLength<G extends GtuData>
java.lang.Object
org.opentrafficsim.kpi.sampling.DataType<T,G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataType<T,O,float[],G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataFloat<LengthUnit,FloatLength,FloatLengthVector,G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataLength<G>
- Type Parameters:
G- GTU data type
- All Implemented Interfaces:
Identifiable
public abstract class ExtendedDataLength<G extends GtuData>
extends ExtendedDataFloat<LengthUnit,FloatLength,FloatLengthVector,G>
Extended data type for length values.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final FloatLengthVectorconvert(float[] storage) Convert float array to typed array.protected final FloatLengthconvertValue(float value) Convert float to typed value.interpolate(FloatLength value0, FloatLength value1, double f) Interpolate value between two measured values.parseValue(String string) Parses a stored string representation to original type.Methods inherited from class org.opentrafficsim.kpi.sampling.data.ExtendedDataFloat
convert, getOutputValue, getStorageValue, initializeStorage, setValueMethods inherited from class org.opentrafficsim.kpi.sampling.data.ExtendedDataType
getValue, toString
-
Constructor Details
-
ExtendedDataLength
Constructor.- Parameters:
id- iddescription- description
-
-
Method Details
-
convertValue
Description copied from class:ExtendedDataFloatConvert float to typed value.- Specified by:
convertValuein classExtendedDataFloat<LengthUnit,FloatLength, FloatLengthVector, G extends GtuData> - Parameters:
value- float value- Returns:
- typed value
-
convert
Description copied from class:ExtendedDataFloatConvert float array to typed array.- Specified by:
convertin classExtendedDataFloat<LengthUnit,FloatLength, FloatLengthVector, G extends GtuData> - Parameters:
storage- float array storage- Returns:
- typed array
-
interpolate
Description copied from class:ExtendedDataTypeInterpolate value between two measured values. The default implementation takes a linear interpolation over time forDoubleScalar,FloatScalar,DoubleandFloat, or the closest value in time otherwise.- Overrides:
interpolatein classExtendedDataType<FloatLength,FloatLengthVector, float[], G extends GtuData> - Parameters:
value0- first valuevalue1- second valuef- interpolation fraction- Returns:
- interpolated value
-
parseValue
Description copied from class:ExtendedDataFloatParses a stored string representation to original type.- Specified by:
parseValuein classExtendedDataFloat<LengthUnit,FloatLength, FloatLengthVector, G extends GtuData> - Parameters:
string- stored string representation without unit- Returns:
- value in original type
-