U
- unitT
- type in vectorO
- vector typeG
- gtu data typepublic abstract class ExtendedDataTypeFloat<U extends Unit<U>,T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,G extends GtuDataInterface> extends ExtendedDataType<T,O,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 |
---|
ExtendedDataTypeFloat(String id)
Constructor setting the id.
|
Modifier and Type | Method and Description |
---|---|
protected abstract O |
convert(float[] storage)
Convert float array to typed array.
|
O |
convert(float[] storage,
int size)
Convert storage type to output type.
|
protected abstract T |
convertValue(float value)
Convert float to typed value.
|
String |
formatValue(String format,
T value)
Formats the value into a string.
|
T |
getOutputValue(O output,
int i)
Returns a specific output value.
|
T |
getStorageValue(float[] storage,
int i)
Returns a specific storage value.
|
float[] |
initializeStorage()
Returns an initial storage object.
|
float[] |
setValue(float[] storage,
int i,
T value)
Returns an updated list/array/vector of the storage type, including a new value at given index.
|
equals, getId, getValue, hashCode, interpolate
public ExtendedDataTypeFloat(String id)
id
- String; idpublic final float[] setValue(float[] storage, int i, T value)
setValue
in class ExtendedDataType<T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>
storage
- S; storagei
- int; index to store next valuevalue
- T; value to addpublic final float[] initializeStorage()
initializeStorage
in class ExtendedDataType<T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>
public final String formatValue(String format, T value)
String.format(format, value.si);
formatValue
in class ExtendedDataType<T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>
format
- String; formatvalue
- T; valuepublic final T getOutputValue(O output, int i) throws SamplingException
getOutputValue
in class ExtendedDataType<T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>
output
- O; outputi
- int; index of value to returnSamplingException
- when i
is out of bounds.public T getStorageValue(float[] storage, int i) throws SamplingException
getStorageValue
in class ExtendedDataType<T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>
storage
- S; storagei
- int; index of value to returnSamplingException
- when i
is out of bounds.protected abstract T convertValue(float value)
value
- float; float valuepublic O convert(float[] storage, int size)
convert
in class ExtendedDataType<T extends AbstractFloatScalar<U,T>,O extends AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>
storage
- S; stored datasize
- int; size of trajectoryprotected abstract O convert(float[] storage) throws ValueException
storage
- float[]; float array storageValueException
- when float array cannot be convertedCopyright © 2014–2019 Delft University of Technology. All rights reserved.