public class FloatPosition extends TypedFloatScalarAbs<LengthUnit,FloatPosition,FloatLength>
FloatScalar.Abs<LengthUnit> value = new FloatScalar.Abs<LengthUnit>(100.0, LengthUnit.SI);we can now write:
FloatPosition value = new FloatPosition(100.0, LengthUnit.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-04-23 21:28:04 +0200 (Sat, 23 Apr 2016) $, @version $Revision: 191 $, 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 FloatPosition |
ZERO
constant with value zero.
|
si| Constructor and Description |
|---|
FloatPosition(double value,
LengthUnit unit)
Construct FloatPosition scalar using a double value.
|
FloatPosition(float value,
LengthUnit unit)
Construct FloatPosition scalar.
|
FloatPosition(FloatPosition value)
Construct FloatPosition scalar.
|
| Modifier and Type | Method and Description |
|---|---|
protected FloatPosition |
instantiateTypeAbs(float value,
LengthUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
protected FloatLength |
instantiateTypeRel(float value,
LengthUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatPosition |
interpolate(FloatPosition zero,
FloatPosition one,
float ratio)
Interpolate between two values.
|
static FloatPosition |
max(FloatPosition a1,
FloatPosition a2)
Return the maximum value of two absolute scalars.
|
static FloatPosition |
max(FloatPosition a1,
FloatPosition a2,
FloatPosition... an)
Return the maximum value of more than two absolute scalars.
|
static FloatPosition |
min(FloatPosition a1,
FloatPosition a2)
Return the minimum value of two absolute scalars.
|
static FloatPosition |
min(FloatPosition a1,
FloatPosition a2,
FloatPosition... 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 FloatPosition ZERO
public FloatPosition(float value,
LengthUnit unit)
value - float valueunit - unit for the float valuepublic FloatPosition(double value,
LengthUnit unit)
value - float valueunit - unit for the float valuepublic FloatPosition(FloatPosition value)
value - Scalar from which to construct this instanceprotected final FloatPosition instantiateTypeAbs(float value, LengthUnit unit)
instantiateTypeAbs in class TypedFloatScalarAbs<LengthUnit,FloatPosition,FloatLength>value - the float valueunit - the unitprotected final FloatLength instantiateTypeRel(float value, LengthUnit unit)
instantiateTypeRel in class TypedFloatScalarAbs<LengthUnit,FloatPosition,FloatLength>value - the float valueunit - the unitpublic static FloatPosition interpolate(FloatPosition zero, FloatPosition one, float ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static FloatPosition max(FloatPosition a1, FloatPosition a2)
a1 - the first scalara2 - the second scalarpublic static FloatPosition max(FloatPosition a1, FloatPosition a2, FloatPosition... an)
a1 - the first scalara2 - the second scalaran - the other scalarspublic static FloatPosition min(FloatPosition a1, FloatPosition a2)
a1 - the first scalara2 - the second scalarpublic static FloatPosition min(FloatPosition a1, FloatPosition a2, FloatPosition... an)
a1 - the first scalara2 - the second scalaran - the other scalarsCopyright © 2015–2016 Delft University of Technology. All rights reserved.