public class Power extends AbstractDoubleScalarRel<PowerUnit,Power>
DoubleScalar.Rel<PowerUnit> value = new DoubleScalar.Rel<PowerUnit>(100.0, PowerUnit.SI);we can now write:
Power value = new Power(100.0, PowerUnit.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 DJUNITS License.
$LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, by $Author: averbraeck $,
initial version Sep 5, 2015
Modifier and Type | Field and Description |
---|---|
static Power |
NaN
constant with value NaN.
|
static Power |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static Power |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static Power |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static Power |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static Power |
ZERO
constant with value zero.
|
si
Constructor and Description |
---|
Power(double value,
PowerUnit unit)
Construct Power scalar.
|
Power(Power value)
Construct Power scalar.
|
Modifier and Type | Method and Description |
---|---|
static Power |
createSI(double value)
Construct Power scalar.
|
ElectricalPotential |
divideBy(ElectricalCurrent v)
Calculate the division of Power and ElectricalCurrent, which results in a ElectricalPotential scalar.
|
ElectricalCurrent |
divideBy(ElectricalPotential v)
Calculate the division of Power and ElectricalPotential, which results in a ElectricalCurrent scalar.
|
Frequency |
divideBy(Energy v)
Calculate the division of Power and Energy, which results in a Frequency scalar.
|
Speed |
divideBy(Force v)
Calculate the division of Power and Force, which results in a Speed scalar.
|
Energy |
divideBy(Frequency v)
Calculate the division of Power and Frequency, which results in a Energy scalar.
|
Dimensionless |
divideBy(Power v)
Calculate the division of Power and Power, which results in a Dimensionless scalar.
|
Force |
divideBy(Speed v)
Calculate the division of Power and Speed, which results in a Force scalar.
|
Power |
instantiateRel(double value,
PowerUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static Power |
interpolate(Power zero,
Power one,
double ratio)
Interpolate between two values.
|
static Power |
max(Power r1,
Power r2)
Return the maximum value of two relative scalars.
|
static Power |
max(Power r1,
Power r2,
Power... rn)
Return the maximum value of more than two relative scalars.
|
static Power |
min(Power r1,
Power r2)
Return the minimum value of two relative scalars.
|
static Power |
min(Power r1,
Power r2,
Power... rn)
Return the minimum value of more than two relative scalars.
|
Energy |
multiplyBy(Duration v)
Calculate the multiplication of Power and Duration, which results in a Energy 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 Power ZERO
public static final Power NaN
public static final Power POSITIVE_INFINITY
public static final Power NEGATIVE_INFINITY
public static final Power POS_MAXVALUE
public static final Power NEG_MAXVALUE
public Power(double value, PowerUnit unit)
value
- double valueunit
- unit for the double valuepublic Power(Power value)
value
- Scalar from which to construct this instancepublic final Power instantiateRel(double value, PowerUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<PowerUnit,Power>
value
- the double valueunit
- the unitpublic static final Power createSI(double value)
value
- double value in SI unitspublic static Power interpolate(Power zero, Power one, double ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static Power max(Power r1, Power r2)
r1
- the first scalarr2
- the second scalarpublic static Power max(Power r1, Power r2, Power... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static Power min(Power r1, Power r2)
r1
- the first scalarr2
- the second scalarpublic static Power min(Power r1, Power r2, Power... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic final Dimensionless divideBy(Power v)
v
- Power scalarpublic final Energy multiplyBy(Duration v)
v
- Power scalarpublic final Energy divideBy(Frequency v)
v
- Power scalarpublic final Frequency divideBy(Energy v)
v
- Power scalarpublic final Force divideBy(Speed v)
v
- Power scalarpublic final Speed divideBy(Force v)
v
- Power scalarpublic final ElectricalCurrent divideBy(ElectricalPotential v)
v
- Power scalarpublic final ElectricalPotential divideBy(ElectricalCurrent v)
v
- Power scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.