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