public class Power extends TypedDoubleScalarRel<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-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2016-05-28 14:25:52 +0200 (Sat, 28 May 2016) $, @version $Revision: 202 $, by $Author: averbraeck $,
initial version Sep 5, 2015
DoubleScalar.Abs<U extends Unit<U>>, DoubleScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
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 |
|---|---|
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.
|
protected Power |
instantiateTypeRel(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, 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 Power ZERO
public Power(double value,
PowerUnit unit)
value - double valueunit - unit for the double valuepublic Power(Power value)
value - Scalar from which to construct this instanceprotected final Power instantiateTypeRel(double value, PowerUnit unit)
instantiateTypeRel in class TypedDoubleScalarRel<PowerUnit,Power>value - the double valueunit - the unitpublic 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–2016 Delft University of Technology. All rights reserved.