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