U - unitT - type in vectorO - vector typeG - gtu data typepublic abstract class ExtendedDataTypeFloat<U extends org.djunits.unit.Unit<U>,T extends org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.AbstractFloatVector<U,O>,G extends GtuDataInterface> extends ExtendedDataType<T,O,float[],G>
Copyright (c) 2013-2018 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, interpolatepublic ExtendedDataTypeFloat(String id)
id - idpublic final float[] setValue(float[] storage,
int i,
T value)
setValue in class ExtendedDataType<T extends org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>storage - storagei - index to store next valuevalue - value to addpublic final float[] initializeStorage()
initializeStorage in class ExtendedDataType<T extends org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.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 org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>format - formatvalue - valuepublic final T getOutputValue(O output, int i) throws SamplingException
getOutputValue in class ExtendedDataType<T extends org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>output - outputi - 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 org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>storage - storagei - index of value to returnSamplingException - when i is out of bounds.protected abstract T convertValue(float value)
value - float valuepublic O convert(float[] storage, int size)
convert in class ExtendedDataType<T extends org.djunits.value.vfloat.scalar.AbstractFloatScalar<U,T>,O extends org.djunits.value.vfloat.vector.AbstractFloatVector<U,O>,float[],G extends GtuDataInterface>storage - stored datasize - size of trajectoryprotected abstract O convert(float[] storage) throws org.djunits.value.ValueException
storage - float array storageorg.djunits.value.ValueException - when float array cannot be convertedCopyright © 2014–2018 Delft University of Technology. All rights reserved.