public class FloatDirection extends AbstractFloatScalarAbs<DirectionUnit,FloatDirection,AngleUnit,FloatAngle>
FloatScalar.Abs<DirectionUnit> value = new FloatScalar.Abs<DirectionUnit>(100.0, DirectionUnit.SI);we can now write:
FloatDirection value = new FloatDirection(100.0, DirectionUnit.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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2019-02-27 23:44:43 +0100 (Wed, 27 Feb 2019) $, @version $Revision: 333 $, by $Author: averbraeck $,
initial version Sep 1, 2015
| Modifier and Type | Field and Description |
|---|---|
static FloatDirection |
ZERO
constant with value zero.
|
siNUMBER_PATTERN| Constructor and Description |
|---|
FloatDirection(double value,
DirectionUnit unit)
Construct FloatDirection scalar using a double value.
|
FloatDirection(FloatDirection value)
Construct FloatDirection scalar.
|
FloatDirection(float value,
DirectionUnit unit)
Construct FloatDirection scalar.
|
| Modifier and Type | Method and Description |
|---|---|
static FloatDirection |
createSI(float value)
Construct FloatDirection scalar.
|
FloatDirection |
instantiateAbs(float value,
DirectionUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
FloatAngle |
instantiateRel(float value,
AngleUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatDirection |
interpolate(FloatDirection zero,
FloatDirection one,
float ratio)
Interpolate between two values.
|
static FloatDirection |
max(FloatDirection a1,
FloatDirection a2)
Return the maximum value of two absolute scalars.
|
static FloatDirection |
max(FloatDirection a1,
FloatDirection a2,
FloatDirection... an)
Return the maximum value of more than two absolute scalars.
|
static FloatDirection |
min(FloatDirection a1,
FloatDirection a2)
Return the minimum value of two absolute scalars.
|
static FloatDirection |
min(FloatDirection a1,
FloatDirection a2,
FloatDirection... an)
Return the minimum value of more than two absolute scalars.
|
static FloatDirection |
valueOf(String text)
Returns a FloatDirection representation of a textual representation of a value with a unit.
|
ceil, divideBy, floor, minus, minus, multiplyBy, plus, rint, roundcompareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocalebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final FloatDirection ZERO
public FloatDirection(float value,
DirectionUnit unit)
value - float valueunit - unit for the float valuepublic FloatDirection(double value,
DirectionUnit unit)
value - double valueunit - unit for the resulting float valuepublic FloatDirection(FloatDirection value)
value - Scalar from which to construct this instancepublic final FloatDirection instantiateAbs(float value, DirectionUnit unit)
instantiateAbs in class AbstractFloatScalarAbs<DirectionUnit,FloatDirection,AngleUnit,FloatAngle>value - float; the float valueunit - AU; the unitpublic final FloatAngle instantiateRel(float value, AngleUnit unit)
instantiateRel in class AbstractFloatScalarAbs<DirectionUnit,FloatDirection,AngleUnit,FloatAngle>value - float; the float valueunit - RU; the unitpublic static final FloatDirection createSI(float value)
value - float value in BASE unitspublic static FloatDirection interpolate(FloatDirection zero, FloatDirection one, float ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static FloatDirection max(FloatDirection a1, FloatDirection a2)
a1 - the first scalara2 - the second scalarpublic static FloatDirection max(FloatDirection a1, FloatDirection a2, FloatDirection... an)
a1 - the first scalara2 - the second scalaran - the other scalarspublic static FloatDirection min(FloatDirection a1, FloatDirection a2)
a1 - the first scalara2 - the second scalarpublic static FloatDirection min(FloatDirection a1, FloatDirection a2, FloatDirection... an)
a1 - the first scalara2 - the second scalaran - the other scalarspublic static FloatDirection valueOf(String text) throws IllegalArgumentException
text - String; the textual representation to parse into a FloatDirectionIllegalArgumentException - when the text cannot be parsedCopyright © 2015–2019 Delft University of Technology. All rights reserved.