public class FloatTemperature extends AbstractFloatScalarRel<TemperatureUnit,FloatTemperature>
FloatScalar.Rel<TemperatureUnit> value = new FloatScalar.Rel<TemperatureUnit>(100.0, TemperatureUnit.SI);we can now write:
FloatTemperature value = new FloatTemperature(100.0, TemperatureUnit.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 FloatTemperature |
NaN
constant with value NaN.
|
static FloatTemperature |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static FloatTemperature |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static FloatTemperature |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static FloatTemperature |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static FloatTemperature |
ZERO
constant with value zero.
|
si
NUMBER_PATTERN
Constructor and Description |
---|
FloatTemperature(double value,
TemperatureUnit unit)
Construct FloatTemperature scalar using a double value.
|
FloatTemperature(FloatTemperature value)
Construct FloatTemperature scalar.
|
FloatTemperature(float value,
TemperatureUnit unit)
Construct FloatTemperature scalar.
|
Modifier and Type | Method and Description |
---|---|
static FloatTemperature |
createSI(float value)
Construct FloatTemperature scalar.
|
FloatDimensionless |
divideBy(FloatTemperature v)
Calculate the division of FloatTemperature and FloatTemperature, which results in a FloatDimensionless scalar.
|
FloatAbsoluteTemperature |
instantiateAbs(float value,
AbsoluteTemperatureUnit unit)
Construct a new Absolute Immutable FloatScalar of the right type.
|
FloatTemperature |
instantiateRel(float value,
TemperatureUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatTemperature |
interpolate(FloatTemperature zero,
FloatTemperature one,
float ratio)
Interpolate between two values.
|
static FloatTemperature |
max(FloatTemperature r1,
FloatTemperature r2)
Return the maximum value of two relative scalars.
|
static FloatTemperature |
max(FloatTemperature r1,
FloatTemperature r2,
FloatTemperature... rn)
Return the maximum value of more than two relative scalars.
|
static FloatTemperature |
min(FloatTemperature r1,
FloatTemperature r2)
Return the minimum value of two relative scalars.
|
static FloatTemperature |
min(FloatTemperature r1,
FloatTemperature r2,
FloatTemperature... rn)
Return the minimum value of more than two relative scalars.
|
FloatAbsoluteTemperature |
plus(FloatAbsoluteTemperature v)
Relative scalar plus Absolute scalar = Absolute scalar.
|
static FloatTemperature |
valueOf(String text)
Returns a FloatTemperature 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 FloatTemperature ZERO
public static final FloatTemperature NaN
public static final FloatTemperature POSITIVE_INFINITY
public static final FloatTemperature NEGATIVE_INFINITY
public static final FloatTemperature POS_MAXVALUE
public static final FloatTemperature NEG_MAXVALUE
public FloatTemperature(float value, TemperatureUnit unit)
value
- float valueunit
- unit for the float valuepublic FloatTemperature(FloatTemperature value)
value
- Scalar from which to construct this instancepublic FloatTemperature(double value, TemperatureUnit unit)
value
- double valueunit
- unit for the resulting float valuepublic final FloatTemperature instantiateRel(float value, TemperatureUnit unit)
instantiateRel
in class AbstractFloatScalarRel<TemperatureUnit,FloatTemperature>
value
- float; the float valueunit
- U; the unitpublic static final FloatTemperature createSI(float value)
value
- float value in SI unitspublic final FloatAbsoluteTemperature instantiateAbs(float value, AbsoluteTemperatureUnit unit)
value
- the float valueunit
- the unitpublic static FloatTemperature interpolate(FloatTemperature zero, FloatTemperature one, float ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic final FloatAbsoluteTemperature plus(FloatAbsoluteTemperature v)
v
- the value to addpublic static FloatTemperature max(FloatTemperature r1, FloatTemperature r2)
r1
- the first scalarr2
- the second scalarpublic static FloatTemperature max(FloatTemperature r1, FloatTemperature r2, FloatTemperature... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatTemperature min(FloatTemperature r1, FloatTemperature r2)
r1
- the first scalarr2
- the second scalarpublic static FloatTemperature min(FloatTemperature r1, FloatTemperature r2, FloatTemperature... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatTemperature valueOf(String text) throws IllegalArgumentException
text
- String; the textual representation to parse into a FloatTemperatureIllegalArgumentException
- when the text cannot be parsedpublic final FloatDimensionless divideBy(FloatTemperature v)
v
- FloatTemperature scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.