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