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-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 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
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.
|
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 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; float valueunit
- TemperatureUnit; unit for the float valuepublic FloatTemperature(FloatTemperature value)
value
- FloatTemperature; Scalar from which to construct this instancepublic FloatTemperature(double value, TemperatureUnit unit)
value
- double; double valueunit
- TemperatureUnit; 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; float value in SI unitspublic final FloatAbsoluteTemperature instantiateAbs(float value, AbsoluteTemperatureUnit unit)
value
- float; the float valueunit
- AbsoluteTemperatureUnit; the unitpublic static FloatTemperature interpolate(FloatTemperature zero, FloatTemperature one, float ratio)
zero
- FloatTemperature; the low valueone
- FloatTemperature; the high valueratio
- float; the ratio between 0 and 1, inclusivepublic final FloatAbsoluteTemperature plus(FloatAbsoluteTemperature v)
v
- FloatAbsoluteTemperature; the value to addpublic static FloatTemperature max(FloatTemperature r1, FloatTemperature r2)
r1
- FloatTemperature; the first scalarr2
- FloatTemperature; the second scalarpublic static FloatTemperature max(FloatTemperature r1, FloatTemperature r2, FloatTemperature... rn)
r1
- FloatTemperature; the first scalarr2
- FloatTemperature; the second scalarrn
- FloatTemperature...; the other scalarspublic static FloatTemperature min(FloatTemperature r1, FloatTemperature r2)
r1
- FloatTemperature; the first scalarr2
- FloatTemperature; the second scalarpublic static FloatTemperature min(FloatTemperature r1, FloatTemperature r2, FloatTemperature... rn)
r1
- FloatTemperature; the first scalarr2
- FloatTemperature; the second scalarrn
- FloatTemperature...; the other scalarspublic final FloatDimensionless divideBy(FloatTemperature v)
v
- FloatTemperature; FloatTemperature scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.