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-03-03 00:53:50 +0100 (Sun, 03 Mar 2019) $, @version $Revision: 349 $, 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
NUMBER_PATTERN
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.
|
static FloatLength |
valueOf(String text)
Returns a FloatLength representation of a textual representation of a value with a unit.
|
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, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
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 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 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 value in SI unitspublic final FloatPosition instantiateAbs(float value, PositionUnit 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 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 static FloatLength valueOf(String text) throws IllegalArgumentException
text
- String; the textual representation to parse into a FloatLengthIllegalArgumentException
- when the text cannot be parsedpublic 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–2019 Delft University of Technology. All rights reserved.