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