public class FloatLength extends AbstractFloatScalarRel<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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2019-01-18 00:35:01 +0100 (Fri, 18 Jan 2019) $, @version $Revision: 324 $, by $Author: averbraeck $,
initial version Sep 1, 2015
Modifier and Type | Field and Description |
---|---|
static FloatLength |
NaN
constant with value NaN.
|
static FloatLength |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static FloatLength |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static FloatLength |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static FloatLength |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
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 |
---|---|
static FloatLength |
createSI(float value)
Construct FloatLength scalar.
|
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.
|
FloatPosition |
instantiateAbs(float value,
PositionUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
FloatLength |
instantiateRel(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.
|
abs, ceil, divideBy, floor, minus, multiplyBy, neg, plus, rint, round
compareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toString
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public static final FloatLength ZERO
public static final FloatLength NaN
public static final FloatLength POSITIVE_INFINITY
public static final FloatLength NEGATIVE_INFINITY
public static final FloatLength POS_MAXVALUE
public static final FloatLength NEG_MAXVALUE
public FloatLength(float value, LengthUnit unit)
value
- float; float valueunit
- LengthUnit; unit for the float valuepublic FloatLength(FloatLength value)
value
- FloatLength; Scalar from which to construct this instancepublic FloatLength(double value, LengthUnit unit)
value
- double; double valueunit
- LengthUnit; unit for the resulting float valuepublic final FloatLength instantiateRel(float value, LengthUnit unit)
instantiateRel
in class AbstractFloatScalarRel<LengthUnit,FloatLength>
value
- float; the float valueunit
- U; the unitpublic static final FloatLength createSI(float value)
value
- float; float value in SI unitspublic final FloatPosition instantiateAbs(float value, PositionUnit unit)
value
- float; the float valueunit
- PositionUnit; the unitpublic static FloatLength interpolate(FloatLength zero, FloatLength one, float ratio)
zero
- FloatLength; the low valueone
- FloatLength; the high valueratio
- float; the ratio between 0 and 1, inclusivepublic final FloatPosition plus(FloatPosition v)
v
- FloatPosition; the value to addpublic static FloatLength max(FloatLength r1, FloatLength r2)
r1
- FloatLength; the first scalarr2
- FloatLength; the second scalarpublic static FloatLength max(FloatLength r1, FloatLength r2, FloatLength... rn)
r1
- FloatLength; the first scalarr2
- FloatLength; the second scalarrn
- FloatLength...; the other scalarspublic static FloatLength min(FloatLength r1, FloatLength r2)
r1
- FloatLength; the first scalarr2
- FloatLength; the second scalarpublic static FloatLength min(FloatLength r1, FloatLength r2, FloatLength... rn)
r1
- FloatLength; the first scalarr2
- FloatLength; the second scalarrn
- FloatLength...; the other scalarspublic final FloatDimensionless divideBy(FloatLength v)
v
- FloatLength; FloatLength scalarpublic final FloatArea multiplyBy(FloatLength v)
v
- FloatLength; FloatLength scalarpublic final FloatArea divideBy(FloatLinearDensity v)
v
- FloatLinearDensity; FloatLength scalarpublic final FloatLinearDensity divideBy(FloatArea v)
v
- FloatArea; FloatLength scalarpublic final FloatVolume multiplyBy(FloatArea v)
v
- FloatArea; FloatLength scalarpublic final FloatEnergy multiplyBy(FloatForce v)
v
- FloatForce; FloatLength scalarpublic final FloatSpeed multiplyBy(FloatFrequency v)
v
- FloatFrequency; FloatLength scalarpublic final FloatSpeed divideBy(FloatDuration v)
v
- FloatDuration; FloatLength scalarpublic final FloatDuration divideBy(FloatSpeed v)
v
- FloatSpeed; FloatLength scalarpublic final FloatMoney multiplyBy(FloatMoneyPerLength v)
v
- FloatMoneyPerLength; FloatLength scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.