public class Temperature extends TypedDoubleScalarRel<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-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2016-05-28 14:25:52 +0200 (Sat, 28 May 2016) $, @version $Revision: 202 $, by $Author: averbraeck $,
initial version Sep 1, 2015
DoubleScalar.Abs<U extends Unit<U>>, DoubleScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
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 |
|---|---|
Dimensionless |
divideBy(Temperature v)
Calculate the division of Temperature and Temperature, which results in a Dimensionless scalar.
|
protected AbsoluteTemperature |
instantiateTypeAbs(double value,
TemperatureUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
protected Temperature |
instantiateTypeRel(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.
|
AbsoluteTemperature |
toAbs()
Translate the relative scalar into an absolute scalar (e.g., before or after a multiplication or division).
|
abs, ceil, divideBy, floor, minus, multiplyBy, plus, rint, roundcompareTo, eq, ge, getSI, gt, le, lt, minus, ne, plusdivide, divide, doubleValue, equals, floatValue, getInUnit, getInUnit, hashCode, interpolate, interpolate, intValue, longValue, minus, minus, minus, multiply, multiply, plus, plus, plus, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelativebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final Temperature ZERO
public Temperature(double value,
TemperatureUnit unit)
value - double valueunit - unit for the double valuepublic Temperature(Temperature value)
value - Scalar from which to construct this instanceprotected final Temperature instantiateTypeRel(double value, TemperatureUnit unit)
instantiateTypeRel in class TypedDoubleScalarRel<TemperatureUnit,Temperature>value - the double valueunit - the unitprotected final AbsoluteTemperature instantiateTypeAbs(double value, TemperatureUnit unit)
value - the double valueunit - the unitpublic 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 final AbsoluteTemperature toAbs()
public 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–2016 Delft University of Technology. All rights reserved.