public class Energy extends AbstractDoubleScalarRel<EnergyUnit,Energy>
DoubleScalar.Rel<EnergyUnit> value = new DoubleScalar.Rel<EnergyUnit>(100.0, EnergyUnit.SI);we can now write:
Energy value = new Energy(100.0, EnergyUnit.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 DJUNITS License.
$LastChangedDate: 2019-03-03 00:53:50 +0100 (Sun, 03 Mar 2019) $, @version $Revision: 349 $, by $Author: averbraeck $,
initial version Sep 5, 2015
| Modifier and Type | Field and Description |
|---|---|
static Energy |
NaN
constant with value NaN.
|
static Energy |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static Energy |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static Energy |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static Energy |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static Energy |
ZERO
constant with value zero.
|
siNUMBER_PATTERN| Constructor and Description |
|---|
Energy(double value,
EnergyUnit unit)
Construct Energy scalar.
|
Energy(Energy value)
Construct Energy scalar.
|
| Modifier and Type | Method and Description |
|---|---|
static Energy |
createSI(double value)
Construct Energy scalar.
|
Power |
divideBy(Duration v)
Calculate the division of Energy and Duration, which results in a Power scalar.
|
Dimensionless |
divideBy(Energy v)
Calculate the division of Energy and Energy, which results in a Dimensionless scalar.
|
Length |
divideBy(Force v)
Calculate the division of Energy and Force, which results in a Length scalar.
|
Force |
divideBy(Length v)
Calculate the division of Energy and Length, which results in a Force scalar.
|
Duration |
divideBy(Power v)
Calculate the division of Energy and Power, which results in a Duration scalar.
|
Pressure |
divideBy(Volume v)
Calculate the division of Energy and Volume, which results in a Pressure scalar.
|
Energy |
instantiateRel(double value,
EnergyUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static Energy |
interpolate(Energy zero,
Energy one,
double ratio)
Interpolate between two values.
|
static Energy |
max(Energy r1,
Energy r2)
Return the maximum value of two relative scalars.
|
static Energy |
max(Energy r1,
Energy r2,
Energy... rn)
Return the maximum value of more than two relative scalars.
|
static Energy |
min(Energy r1,
Energy r2)
Return the minimum value of two relative scalars.
|
static Energy |
min(Energy r1,
Energy r2,
Energy... rn)
Return the minimum value of more than two relative scalars.
|
Power |
multiplyBy(Frequency v)
Calculate the multiplication of Energy and Frequency, which results in a Power scalar.
|
Force |
multiplyBy(LinearDensity v)
Calculate the multiplication of Energy and LinearDensity, which results in a Force scalar.
|
Money |
multiplyBy(MoneyPerEnergy v)
Calculate the multiplication of Energy and MoneyPerEnergy, which results in a Money scalar.
|
static Energy |
valueOf(String text)
Returns a Energy 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 Energy ZERO
public static final Energy NaN
public static final Energy POSITIVE_INFINITY
public static final Energy NEGATIVE_INFINITY
public static final Energy POS_MAXVALUE
public static final Energy NEG_MAXVALUE
public Energy(double value,
EnergyUnit unit)
value - double valueunit - unit for the double valuepublic Energy(Energy value)
value - Scalar from which to construct this instancepublic final Energy instantiateRel(double value, EnergyUnit unit)
instantiateRel in class AbstractDoubleScalarRel<EnergyUnit,Energy>value - double; the double valueunit - U; the unitpublic static final Energy createSI(double value)
value - double value in SI unitspublic static Energy interpolate(Energy zero, Energy one, double ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static Energy max(Energy r1, Energy r2)
r1 - the first scalarr2 - the second scalarpublic static Energy max(Energy r1, Energy r2, Energy... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static Energy min(Energy r1, Energy r2)
r1 - the first scalarr2 - the second scalarpublic static Energy min(Energy r1, Energy r2, Energy... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static Energy valueOf(String text) throws IllegalArgumentException
text - String; the textual representation to parse into a EnergyIllegalArgumentException - when the text cannot be parsedpublic final Dimensionless divideBy(Energy v)
v - Energy scalarpublic final Length divideBy(Force v)
v - Energy scalarpublic final Force divideBy(Length v)
v - Energy scalarpublic final Force multiplyBy(LinearDensity v)
v - Energy scalarpublic final Power divideBy(Duration v)
v - Energy scalarpublic final Duration divideBy(Power v)
v - Energy scalarpublic final Pressure divideBy(Volume v)
v - Energy scalarpublic final Power multiplyBy(Frequency v)
v - Energy scalarpublic final Money multiplyBy(MoneyPerEnergy v)
v - Energy scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.