public class FloatTime extends TypedFloatScalarAbs<TimeUnit,FloatTime,FloatDuration>
FloatScalar.Abs<TimeUnit> value = new FloatScalar.Abs<TimeUnit>(100.0, TimeUnit.SI);we can now write:
FloatTime value = new FloatTime(100.0, TimeUnit.SI);The compiler will automatically recognize which units belong to which quantity, and whether the quantity type and the unit used are compatible.
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2016-05-28 14:25:52 +0200 (Sat, 28 May 2016) $, @version $Revision: 202 $, by $Author: averbraeck $,
initial version Sep 1, 2015
FloatScalar.Abs<U extends Unit<U>>, FloatScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
static FloatTime |
ZERO
constant with value zero.
|
si| Constructor and Description |
|---|
FloatTime(double value,
TimeUnit unit)
Construct FloatTime scalar using a double value.
|
FloatTime(FloatTime value)
Construct FloatTime scalar.
|
FloatTime(float value,
TimeUnit unit)
Construct FloatTime scalar.
|
| Modifier and Type | Method and Description |
|---|---|
protected FloatTime |
instantiateTypeAbs(float value,
TimeUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
protected FloatDuration |
instantiateTypeRel(float value,
TimeUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatTime |
interpolate(FloatTime zero,
FloatTime one,
float ratio)
Interpolate between two values.
|
static FloatTime |
max(FloatTime a1,
FloatTime a2)
Return the maximum value of two absolute scalars.
|
static FloatTime |
max(FloatTime a1,
FloatTime a2,
FloatTime... an)
Return the maximum value of more than two absolute scalars.
|
static FloatTime |
min(FloatTime a1,
FloatTime a2)
Return the minimum value of two absolute scalars.
|
static FloatTime |
min(FloatTime a1,
FloatTime a2,
FloatTime... an)
Return the minimum value of more than two absolute scalars.
|
ceil, floor, minus, minus, plus, rint, round, toRelcompareTo, divideBy, eq, ge, getSI, gt, le, lt, minus, minus, multiplyBy, ne, plusdivide, divide, doubleValue, equals, floatValue, getInUnit, getInUnit, hashCode, interpolate, interpolate, intValue, longValue, minus, minus, minus, multiply, multiply, plus, plus, plus, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelativebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final FloatTime ZERO
public FloatTime(float value,
TimeUnit unit)
value - float valueunit - unit for the float valuepublic FloatTime(double value,
TimeUnit unit)
value - float valueunit - unit for the float valuepublic FloatTime(FloatTime value)
value - Scalar from which to construct this instanceprotected final FloatTime instantiateTypeAbs(float value, TimeUnit unit)
instantiateTypeAbs in class TypedFloatScalarAbs<TimeUnit,FloatTime,FloatDuration>value - the float valueunit - the unitprotected final FloatDuration instantiateTypeRel(float value, TimeUnit unit)
instantiateTypeRel in class TypedFloatScalarAbs<TimeUnit,FloatTime,FloatDuration>value - the float valueunit - the unitpublic static FloatTime interpolate(FloatTime zero, FloatTime one, float ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static FloatTime max(FloatTime a1, FloatTime a2)
a1 - the first scalara2 - the second scalarpublic static FloatTime max(FloatTime a1, FloatTime a2, FloatTime... an)
a1 - the first scalara2 - the second scalaran - the other scalarspublic static FloatTime min(FloatTime a1, FloatTime a2)
a1 - the first scalara2 - the second scalarCopyright © 2015–2016 Delft University of Technology. All rights reserved.