public class FloatLength extends TypedFloatScalarRel<LengthUnit,FloatLength>
FloatScalar.Rel<LengthUnit> value = new FloatScalar.Rel<LengthUnit>(100.0, LengthUnit.SI);we can now write:
FloatLength value = new FloatLength(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-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 FloatLength |
ZERO
constant with value zero.
|
si| Constructor and Description |
|---|
FloatLength(double value,
LengthUnit unit)
Construct FloatLength scalar using a double value.
|
FloatLength(FloatLength value)
Construct FloatLength scalar.
|
FloatLength(float value,
LengthUnit unit)
Construct FloatLength scalar.
|
| Modifier and Type | Method and Description |
|---|---|
FloatLinearDensity |
divideBy(FloatArea v)
Calculate the division of FloatLength and FloatArea, which results in a FloatLinearDensity scalar.
|
FloatSpeed |
divideBy(FloatDuration v)
Calculate the division of FloatLength and FloatDuration, which results in a FloatSpeed scalar.
|
FloatDimensionless |
divideBy(FloatLength v)
Calculate the division of FloatLength and FloatLength, which results in a FloatDimensionless scalar.
|
FloatArea |
divideBy(FloatLinearDensity v)
Calculate the division of FloatLength and FloatLinearDensity, which results in a FloatArea scalar.
|
FloatDuration |
divideBy(FloatSpeed v)
Calculate the division of FloatLength and FloatSpeed, which results in a FloatDuration scalar.
|
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 FloatLength |
interpolate(FloatLength zero,
FloatLength one,
float ratio)
Interpolate between two values.
|
static FloatLength |
max(FloatLength r1,
FloatLength r2)
Return the maximum value of two relative scalars.
|
static FloatLength |
max(FloatLength r1,
FloatLength r2,
FloatLength... rn)
Return the maximum value of more than two relative scalars.
|
static FloatLength |
min(FloatLength r1,
FloatLength r2)
Return the minimum value of two relative scalars.
|
static FloatLength |
min(FloatLength r1,
FloatLength r2,
FloatLength... rn)
Return the minimum value of more than two relative scalars.
|
FloatVolume |
multiplyBy(FloatArea v)
Calculate the multiplication of FloatLength and FloatArea, which results in a FloatVolume scalar.
|
FloatEnergy |
multiplyBy(FloatForce v)
Calculate the multiplication of FloatLength and FloatForce, which results in a FloatEnergy scalar.
|
FloatSpeed |
multiplyBy(FloatFrequency v)
Calculate the multiplication of FloatLength and FloatFrequency, which results in a FloatSpeed scalar.
|
FloatArea |
multiplyBy(FloatLength v)
Calculate the multiplication of FloatLength and FloatLength, which results in a FloatArea scalar.
|
FloatMoney |
multiplyBy(FloatMoneyPerLength v)
Calculate the multiplication of FloatLength and FloatMoneyPerLength, which results in a FloatMoney scalar.
|
FloatPosition |
plus(FloatPosition v)
Relative scalar plus Absolute scalar = Absolute scalar.
|
FloatPosition |
toAbs()
Translate the relative scalar into an absolute scalar (e.g., before or after a multiplication or division).
|
abs, ceil, divideBy, floor, minus, multiplyBy, plus, rint, roundcompareTo, eq, ge, getSI, gt, le, lt, minus, 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 FloatLength ZERO
public FloatLength(float value,
LengthUnit unit)
value - float valueunit - unit for the float valuepublic FloatLength(FloatLength value)
value - Scalar from which to construct this instancepublic FloatLength(double value,
LengthUnit unit)
value - double valueunit - unit for the resulting float valueprotected final FloatLength instantiateTypeRel(float value, LengthUnit unit)
instantiateTypeRel in class TypedFloatScalarRel<LengthUnit,FloatLength>value - the float valueunit - the unitprotected final FloatPosition instantiateTypeAbs(float value, LengthUnit unit)
value - the float valueunit - the unitpublic static FloatLength interpolate(FloatLength zero, FloatLength one, float ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic final FloatPosition plus(FloatPosition v)
v - the value to addpublic final FloatPosition toAbs()
public static FloatLength max(FloatLength r1, FloatLength r2)
r1 - the first scalarr2 - the second scalarpublic static FloatLength max(FloatLength r1, FloatLength r2, FloatLength... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static FloatLength min(FloatLength r1, FloatLength r2)
r1 - the first scalarr2 - the second scalarpublic static FloatLength min(FloatLength r1, FloatLength r2, FloatLength... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic final FloatDimensionless divideBy(FloatLength v)
v - FloatLength scalarpublic final FloatArea multiplyBy(FloatLength v)
v - FloatLength scalarpublic final FloatArea divideBy(FloatLinearDensity v)
v - FloatLength scalarpublic final FloatLinearDensity divideBy(FloatArea v)
v - FloatLength scalarpublic final FloatVolume multiplyBy(FloatArea v)
v - FloatLength scalarpublic final FloatEnergy multiplyBy(FloatForce v)
v - FloatLength scalarpublic final FloatSpeed multiplyBy(FloatFrequency v)
v - FloatLength scalarpublic final FloatSpeed divideBy(FloatDuration v)
v - FloatLength scalarpublic final FloatDuration divideBy(FloatSpeed v)
v - FloatLength scalarpublic final FloatMoney multiplyBy(FloatMoneyPerLength v)
v - FloatLength scalarCopyright © 2015–2016 Delft University of Technology. All rights reserved.