Interface FloatVectorInterface<U extends Unit<U>,S extends FloatScalarInterface<U,S>,V extends FloatVectorInterface<U,S,V>>
- Type Parameters:
U
- the unitS
- the generic scalar type belonging to UV
- the generic vector type
- All Superinterfaces:
Cloneable
,IndexedValue<U,S,V>
,Iterable<S>
,Serializable
,Value<U,V>
,ValueFunctions<U,V>
,Vector<U,S,V>
- All Known Implementing Classes:
AbstractFloatVector
,AbstractFloatVectorAbs
,AbstractFloatVectorRel
,AbstractFloatVectorRelWithAbs
,FloatAbsoluteTemperatureVector
,FloatAbsorbedDoseVector
,FloatAccelerationVector
,FloatAmountOfSubstanceVector
,FloatAngleVector
,FloatAreaVector
,FloatCatalyticActivityVector
,FloatDensityVector
,FloatDimensionlessVector
,FloatDirectionVector
,FloatDurationVector
,FloatElectricalCapacitanceVector
,FloatElectricalChargeVector
,FloatElectricalConductanceVector
,FloatElectricalCurrentVector
,FloatElectricalInductanceVector
,FloatElectricalPotentialVector
,FloatElectricalResistanceVector
,FloatEnergyVector
,FloatEquivalentDoseVector
,FloatFlowMassVector
,FloatFlowVolumeVector
,FloatForceVector
,FloatFrequencyVector
,FloatIlluminanceVector
,FloatLengthVector
,FloatLinearDensityVector
,FloatLuminousFluxVector
,FloatLuminousIntensityVector
,FloatMagneticFluxDensityVector
,FloatMagneticFluxVector
,FloatMassVector
,FloatPositionVector
,FloatPowerVector
,FloatPressureVector
,FloatRadioActivityVector
,FloatSIVector
,FloatSolidAngleVector
,FloatSpeedVector
,FloatTemperatureVector
,FloatTimeVector
,FloatTorqueVector
,FloatVolumeVector
public interface FloatVectorInterface<U extends Unit<U>,S extends FloatScalarInterface<U,S>,V extends FloatVectorInterface<U,S,V>> extends Vector<U,S,V>
Interface for the FloatVector classes, specifically defining the methods that deal with float values.
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.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.djunits.value.base.Vector
Vector.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>, Vector.Rel<U extends Unit<U>,S extends Scalar<U,S>,RV extends Vector.Rel<U,S,RV>>, Vector.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>
-
Method Summary
Modifier and Type Method Description V
assign(FloatFunction floatFunction)
Execute a function on a cell by cell basis.float
getInUnit(int index)
Retrieve the value stored at a specified position in the original unit.float
getInUnit(int index, U targetUnit)
Retrieve the value stored at a specified position converted into a specified unit.float
getSI(int index)
Retrieve the value stored at a specified position in the standard SI unit.float[]
getValuesInUnit()
Create a float[] array filled with the values in the original unit.float[]
getValuesInUnit(U targetUnit)
Create a float[] array filled with the values converted into a specified unit.float[]
getValuesSI()
Create a float[] array filled with the values in the standard SI unit.S
instantiateScalarSI(float valueSI, U displayUnit)
Instantiate a new scalar for the class of this vector.V
instantiateVector(FloatVectorData fvd, U displayUnit)
Instantiate a new vector of the class of this vector.void
set(int index, S value)
Set the scalar value at the specified position.void
setInUnit(int index, float valueInUnit)
Set the value, specified in the (current) display unit, at the specified position.void
setInUnit(int index, float valueInUnit, U valueUnit)
Set the value, specified in thevalueUnit
, at the specified position.void
setSI(int index, float valueSI)
Set the value, specified in the standard SI unit, at the specified position.Methods inherited from interface org.djunits.value.IndexedValue
cardinality, getScalarClass, getStorageType, immutable, isDense, isMutable, isSparse, mutable, toDense, toSparse
Methods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
Method Details
-
getSI
Retrieve the value stored at a specified position in the standard SI unit.- Parameters:
index
- int; index of the value to retrieve- Returns:
- float; value at position index in the standard SI unit
- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
getInUnit
Retrieve the value stored at a specified position in the original unit.- Parameters:
index
- int; index of the value to retrieve- Returns:
- float; value at position index in the original unit
- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
getInUnit
Retrieve the value stored at a specified position converted into a specified unit.- Parameters:
index
- int; index of the value to retrievetargetUnit
- U; the unit for the result- Returns:
- float; value at position index converted into the specified unit
- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
getValuesSI
float[] getValuesSI()Create a float[] array filled with the values in the standard SI unit.- Returns:
- float[]; array of values in the standard SI unit
-
getValuesInUnit
float[] getValuesInUnit()Create a float[] array filled with the values in the original unit.- Returns:
- float[]; the values in the original unit
-
getValuesInUnit
Create a float[] array filled with the values converted into a specified unit.- Parameters:
targetUnit
- U; the unit into which the values are converted for use- Returns:
- float[]; the values converted into the specified unit
-
setSI
Set the value, specified in the standard SI unit, at the specified position.- Parameters:
index
- int; the index of the value to setvalueSI
- float; the value, specified in the standard SI unit- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
setInUnit
Set the value, specified in the (current) display unit, at the specified position.- Parameters:
index
- int; the index of the value to setvalueInUnit
- float; the value, specified in the (current) display unit- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
setInUnit
Set the value, specified in thevalueUnit
, at the specified position.- Parameters:
index
- int; the index of the value to setvalueInUnit
- float; the value, specified in the (current) display unitvalueUnit
- U; the unit in which thevalueInUnit
is expressed- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
set
Set the scalar value at the specified position.- Parameters:
index
- int; the index of the value to setvalue
- S; the value to set- Throws:
ValueRuntimeException
- when index out of range (index < 0 or index >= size())
-
assign
Execute a function on a cell by cell basis. Note: May be expensive when used on sparse data.- Parameters:
floatFunction
- FloatFunction; the function to apply- Returns:
- V; this updated vector
-
instantiateVector
Instantiate a new vector of the class of this vector. This can be used instead of the FloatVector.instiantiate() methods in case another vector of this class is known. The method is faster than FloatVector.instantiate, and it will also work if the vector is user-defined.- Parameters:
fvd
- FloatVectorData; the data used to instantiate the vectordisplayUnit
- U; the display unit of the vector- Returns:
- V; a vector of the correct type
-
instantiateScalarSI
Instantiate a new scalar for the class of this vector. This can be used instead of the FloatScalar.instiantiate() methods in case a vector of this class is known. The method is faster than FloatScalar.instantiate, and it will also work if the vector and/or scalar are user-defined.- Parameters:
valueSI
- float; the SI value of the scalardisplayUnit
- U; the unit in which the value will be displayed- Returns:
- S; a scalar of the correct type, belonging to the vector type
-