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