G
- gtu data typepublic abstract class ExtendedDataTypeNumber<G extends GtuDataInterface> extends ExtendedDataType<Float,float[],float[],G>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
ExtendedDataTypeNumber(String id)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
float[] |
convert(float[] storage,
int size)
Convert storage type to output type.
|
String |
formatValue(String format,
Float value)
Formats the value into a string.
|
Float |
getOutputValue(float[] output,
int index)
Returns a specific output value.
|
Float |
getStorageValue(float[] storage,
int index)
Returns a specific storage value.
|
float[] |
initializeStorage()
Returns an initial storage object.
|
float[] |
setValue(float[] storage,
int index,
Float value)
Returns an updated list/array/vector of the storage type, including a new value at given index.
|
equals, getId, getValue, hashCode, interpolate
public ExtendedDataTypeNumber(String id)
id
- String; idpublic float[] setValue(float[] storage, int index, Float value)
setValue
in class ExtendedDataType<Float,float[],float[],G extends GtuDataInterface>
storage
- S; storageindex
- int; index to store next valuevalue
- T; value to addpublic Float getOutputValue(float[] output, int index) throws SamplingException
getOutputValue
in class ExtendedDataType<Float,float[],float[],G extends GtuDataInterface>
output
- O; outputindex
- int; index of value to returnSamplingException
- when i
is out of bounds.public Float getStorageValue(float[] storage, int index) throws SamplingException
getStorageValue
in class ExtendedDataType<Float,float[],float[],G extends GtuDataInterface>
storage
- S; storageindex
- int; index of value to returnSamplingException
- when i
is out of bounds.public float[] initializeStorage()
initializeStorage
in class ExtendedDataType<Float,float[],float[],G extends GtuDataInterface>
public float[] convert(float[] storage, int size)
convert
in class ExtendedDataType<Float,float[],float[],G extends GtuDataInterface>
storage
- S; stored datasize
- int; size of trajectorypublic String formatValue(String format, Float value)
String.format(format, value.si);
formatValue
in class ExtendedDataType<Float,float[],float[],G extends GtuDataInterface>
format
- String; formatvalue
- T; valueCopyright © 2014–2019 Delft University of Technology. All rights reserved.