public final class DoubleVectorUtil 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 AbstractDoubleVector<U,S>> |
instantiate(double[] value,
U unit,
StorageType storageType)
Instantiate the DoubleVector based on its unit.
|
static <S extends AbstractDoubleVector<?,S>> |
instantiateAnonymous(double[] value,
Unit<?> unit,
StorageType storageType)
Instantiate the DoubleVector based on its unit.
|
static <S extends AbstractDoubleVector<?,S>> |
instantiateAnonymousSI(double[] si,
Unit<?> displayUnit,
StorageType storageType)
Instantiate the DoubleVector based on its unit.
|
static <U extends Unit<U>,S extends AbstractDoubleVector<U,S>> |
instantiateSI(double[] si,
U displayUnit,
StorageType storageType)
Instantiate the DoubleVector based on its unit.
|
public static <U extends Unit<U>,S extends AbstractDoubleVector<U,S>> S instantiate(double[] value, U unit, StorageType storageType) throws ValueException
U
- the unitS
- the return typevalue
- double[]; 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 AbstractDoubleVector<?,S>> S instantiateAnonymous(double[] value, Unit<?> unit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = DoubleVectorUtil.instantiateAnonymous(10.0, mlu);
S
- the return typevalue
- double[]; 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 AbstractDoubleVector<U,S>> S instantiateSI(double[] si, U displayUnit, StorageType storageType) throws ValueException
U
- the unitS
- the return typesi
- double[]; 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 AbstractDoubleVector<?,S>> S instantiateAnonymousSI(double[] si, Unit<?> displayUnit, StorageType storageType) throws ValueException
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = DoubleVectorUtil.instantiateAnonymousSI(10.0, mlu);
S
- the return typesi
- double[]; 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.