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-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, 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 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
- the double valueunit
- 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 final Dimensionless divideBy(Temperature v)
v
- Temperature scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.