public final class FloatVectorUtil extends Object
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
static <U extends Unit<U>,S extends AbstractFloatVector<U,S>> |
instantiate(float[] value,
U unit,
StorageType storageType)
Instantiate the FloatVector based on its unit.
|
static <S extends AbstractFloatVector<?,S>> |
instantiateAnonymous(float[] value,
Unit<?> unit,
StorageType storageType)
Instantiate the FloatVector based on its unit.
|
static <S extends AbstractFloatVector<?,S>> |
instantiateAnonymousSI(float[] si,
Unit<?> displayUnit,
StorageType storageType)
Instantiate the FloatVector based on its unit.
|
static <U extends Unit<U>,S extends AbstractFloatVector<U,S>> |
instantiateSI(float[] si,
U displayUnit,
StorageType storageType)
Instantiate the FloatVector based on its unit.
|
public static <U extends Unit<U>,S extends AbstractFloatVector<U,S>> S instantiate(float[] value, U unit, StorageType storageType) throws ValueException
U
- the unitS
- the return typevalue
- float[]; the valueunit
- U; the unit in which the value is expressedstorageType
- StorageType; whether the vector is SPARSE or DENSEValueException
- on vector init errorpublic static <S extends AbstractFloatVector<?,S>> S instantiateAnonymous(float[] value, Unit<?> unit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = FloatVectorUtil.instantiateAnonymous(10.0, mlu);
S
- the return typevalue
- float[]; the valueunit
- Unit<?>; the unit in which the value is expressedstorageType
- StorageType; whether the vector is SPARSE or DENSEValueException
- on vector init errorpublic static <U extends Unit<U>,S extends AbstractFloatVector<U,S>> S instantiateSI(float[] si, U displayUnit, StorageType storageType) throws ValueException
U
- the unitS
- the return typesi
- float[]; the value in SI unitsdisplayUnit
- U; the unit in which the value is expressedstorageType
- StorageType; whether the vector is SPARSE or DENSEValueException
- on vector init errorpublic static <S extends AbstractFloatVector<?,S>> S instantiateAnonymousSI(float[] si, Unit<?> displayUnit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = FloatVectorUtil.instantiateAnonymousSI(10.0, mlu);
S
- the return typesi
- float[]; the value in SI unitsdisplayUnit
- Unit<?>; the unit in which the value is expressedstorageType
- StorageType; whether the vector is SPARSE or DENSEValueException
- on vector init errorCopyright © 2015–2019 Delft University of Technology. All rights reserved.