public class MoneyPerEnergy extends AbstractDoubleScalarRel<MoneyPerEnergyUnit,MoneyPerEnergy>
DoubleScalar.Rel<MoneyPerEnergyUnit> value = new DoubleScalar.Rel<MoneyPerEnergyUnit>(100.0, MoneyPerEnergyUnit.SI);we can now write:
MoneyPerEnergy value = new MoneyPerEnergy(100.0, MoneyPerEnergyUnit.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-01-18 00:35:01 +0100 (Fri, 18 Jan 2019) $, @version $Revision: 324 $, by $Author: averbraeck $,
initial version Sep 5, 2015
si
Constructor and Description |
---|
MoneyPerEnergy(double value,
MoneyPerEnergyUnit unit)
Construct MoneyPerEnergy scalar.
|
MoneyPerEnergy(MoneyPerEnergy value)
Construct MoneyPerEnergy scalar.
|
Modifier and Type | Method and Description |
---|---|
Dimensionless |
divideBy(MoneyPerEnergy v)
Calculate the division of MoneyPerEnergy and MoneyPerEnergy, which results in a Dimensionless scalar.
|
MoneyPerEnergy |
instantiateRel(double value,
MoneyPerEnergyUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static MoneyPerEnergy |
interpolate(MoneyPerEnergy zero,
MoneyPerEnergy one,
double ratio)
Interpolate between two values.
|
static MoneyPerEnergy |
max(MoneyPerEnergy r1,
MoneyPerEnergy r2)
Return the maximum value of two monetary scalars.
|
static MoneyPerEnergy |
max(MoneyPerEnergy r1,
MoneyPerEnergy r2,
MoneyPerEnergy... rn)
Return the maximum value of more than two monetary scalars.
|
static MoneyPerEnergy |
min(MoneyPerEnergy r1,
MoneyPerEnergy r2)
Return the minimum value of two monetary scalars.
|
static MoneyPerEnergy |
min(MoneyPerEnergy r1,
MoneyPerEnergy r2,
MoneyPerEnergy... rn)
Return the minimum value of more than two monetary scalars.
|
Money |
multiplyBy(Energy v)
Calculate the multiplication of MoneyPerEnergy and Energy, which results in a Money 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 MoneyPerEnergy(double value, MoneyPerEnergyUnit unit)
value
- double; double valueunit
- MoneyPerEnergyUnit; unit for the double valuepublic MoneyPerEnergy(MoneyPerEnergy value)
value
- MoneyPerEnergy; Scalar from which to construct this instancepublic final MoneyPerEnergy instantiateRel(double value, MoneyPerEnergyUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<MoneyPerEnergyUnit,MoneyPerEnergy>
value
- double; the double valueunit
- U; the unitpublic static MoneyPerEnergy interpolate(MoneyPerEnergy zero, MoneyPerEnergy one, double ratio)
zero
- MoneyPerEnergy; the low valueone
- MoneyPerEnergy; the high valueratio
- double; the ratio between 0 and 1, inclusivepublic static MoneyPerEnergy max(MoneyPerEnergy r1, MoneyPerEnergy r2)
r1
- MoneyPerEnergy; the first scalarr2
- MoneyPerEnergy; the second scalarpublic static MoneyPerEnergy max(MoneyPerEnergy r1, MoneyPerEnergy r2, MoneyPerEnergy... rn)
r1
- MoneyPerEnergy; the first scalarr2
- MoneyPerEnergy; the second scalarrn
- MoneyPerEnergy...; the other scalarspublic static MoneyPerEnergy min(MoneyPerEnergy r1, MoneyPerEnergy r2)
r1
- MoneyPerEnergy; the first scalarr2
- MoneyPerEnergy; the second scalarpublic static MoneyPerEnergy min(MoneyPerEnergy r1, MoneyPerEnergy r2, MoneyPerEnergy... rn)
r1
- MoneyPerEnergy; the first scalarr2
- MoneyPerEnergy; the second scalarrn
- MoneyPerEnergy...; the other scalarspublic final Dimensionless divideBy(MoneyPerEnergy v)
v
- MoneyPerEnergy; MoneyPerEnergy scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.