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