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-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 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.
|
siNUMBER_PATTERN| 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.
|
static Temperature |
valueOf(String text)
Returns a Temperature representation of a textual representation of a value with a unit.
|
abs, ceil, divideBy, floor, minus, multiplyBy, neg, plus, rint, roundcompareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocalebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic 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 valueunit - unit for the double valuepublic Temperature(Temperature value)
value - 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 - the double valueunit - the unitpublic static final Temperature createSI(double value)
value - double value in SI unitspublic static Temperature interpolate(Temperature zero, Temperature one, double ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic final AbsoluteTemperature plus(AbsoluteTemperature v)
v - the value to addpublic static Temperature max(Temperature r1, Temperature r2)
r1 - the first scalarr2 - the second scalarpublic static Temperature max(Temperature r1, Temperature r2, Temperature... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static Temperature min(Temperature r1, Temperature r2)
r1 - the first scalarr2 - the second scalarpublic static Temperature min(Temperature r1, Temperature r2, Temperature... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static Temperature valueOf(String text) throws IllegalArgumentException
text - String; the textual representation to parse into a TemperatureIllegalArgumentException - when the text cannot be parsedpublic final Dimensionless divideBy(Temperature v)
v - Temperature scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.