public final class FloatScalarUtil 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 AbstractFloatScalar<U,S>> |
instantiate(float value,
U unit)
Instantiate the DoubleScalar based on its unit.
|
static <S extends AbstractFloatScalar<?,S>> |
instantiateAnonymous(float value,
Unit<?> unit)
Instantiate the DoubleScalar based on its unit.
|
static <S extends AbstractFloatScalar<?,S>> |
instantiateAnonymousSI(float si,
Unit<?> displayUnit)
Instantiate the DoubleScalar based on its unit.
|
static <U extends Unit<U>,S extends AbstractFloatScalar<U,S>> |
instantiateSI(float si,
U displayUnit)
Instantiate the DoubleScalar based on its unit.
|
public static <U extends Unit<U>,S extends AbstractFloatScalar<U,S>> S instantiate(float value, U unit)
U
- the unitS
- the return typevalue
- float; the valueunit
- U; the unit in which the value is expressedpublic static <S extends AbstractFloatScalar<?,S>> S instantiateAnonymous(float value, Unit<?> unit)
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = DoubleScalarUtil.instantiateAnonymous(10.0, mlu);
S
- the return typevalue
- float; the valueunit
- Unit<?>; the unit in which the value is expressedpublic static <U extends Unit<U>,S extends AbstractFloatScalar<U,S>> S instantiateSI(float si, U displayUnit)
U
- the unitS
- the return typesi
- float; the value in SI unitsdisplayUnit
- U; the unit in which the value is expressedpublic static <S extends AbstractFloatScalar<?,S>> S instantiateAnonymousSI(float si, Unit<?> displayUnit)
MoneyPerLengthUnit mlu = new MoneyPerLengthUnit(MoneyUnit.USD, LengthUnit.METER, "$/m", "$/m"); MoneyPerArea mpa = DoubleScalarUtil.instantiateAnonymousSI(10.0, mlu);
S
- the return typesi
- float; the value in SI unitsdisplayUnit
- Unit<?>; the unit in which the value is expressedCopyright © 2015–2019 Delft University of Technology. All rights reserved.