public class MoneyPerMass extends AbstractDoubleScalarRel<MoneyPerMassUnit,MoneyPerMass>
DoubleScalar.Rel<MoneyPerMassUnit> value = new DoubleScalar.Rel<MoneyPerMassUnit>(100.0, MoneyPerMassUnit.SI);we can now write:
MoneyPerMass value = new MoneyPerMass(100.0, MoneyPerMassUnit.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: 2015-10-16 02:04:00 +0200 (Fri, 16 Oct 2015) $, @version $Revision: 113 $, by $Author: averbraeck $,
initial version Sep 5, 2015
si
NUMBER_PATTERN
Constructor and Description |
---|
MoneyPerMass(double value,
MoneyPerMassUnit unit)
Construct MoneyPerMass scalar.
|
MoneyPerMass(MoneyPerMass value)
Construct MoneyPerMass scalar.
|
Modifier and Type | Method and Description |
---|---|
Dimensionless |
divideBy(MoneyPerMass v)
Calculate the division of MoneyPerMass and MoneyPerMass, which results in a Dimensionless scalar.
|
MoneyPerMass |
instantiateRel(double value,
MoneyPerMassUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static MoneyPerMass |
interpolate(MoneyPerMass zero,
MoneyPerMass one,
double ratio)
Interpolate between two values.
|
static MoneyPerMass |
max(MoneyPerMass r1,
MoneyPerMass r2)
Return the maximum value of two monetary scalars.
|
static MoneyPerMass |
max(MoneyPerMass r1,
MoneyPerMass r2,
MoneyPerMass... rn)
Return the maximum value of more than two monetary scalars.
|
static MoneyPerMass |
min(MoneyPerMass r1,
MoneyPerMass r2)
Return the minimum value of two monetary scalars.
|
static MoneyPerMass |
min(MoneyPerMass r1,
MoneyPerMass r2,
MoneyPerMass... rn)
Return the minimum value of more than two monetary scalars.
|
Money |
multiplyBy(Mass v)
Calculate the multiplication of MoneyPerMass and Mass, 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, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public MoneyPerMass(double value, MoneyPerMassUnit unit)
value
- double valueunit
- unit for the double valuepublic MoneyPerMass(MoneyPerMass value)
value
- Scalar from which to construct this instancepublic final MoneyPerMass instantiateRel(double value, MoneyPerMassUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<MoneyPerMassUnit,MoneyPerMass>
value
- double; the double valueunit
- U; the unitpublic static MoneyPerMass interpolate(MoneyPerMass zero, MoneyPerMass one, double ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static MoneyPerMass max(MoneyPerMass r1, MoneyPerMass r2)
r1
- the first scalarr2
- the second scalarpublic static MoneyPerMass max(MoneyPerMass r1, MoneyPerMass r2, MoneyPerMass... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static MoneyPerMass min(MoneyPerMass r1, MoneyPerMass r2)
r1
- the first scalarr2
- the second scalarpublic static MoneyPerMass min(MoneyPerMass r1, MoneyPerMass r2, MoneyPerMass... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic final Dimensionless divideBy(MoneyPerMass v)
v
- MoneyPerMass scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.