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