public class FloatMoney extends AbstractFloatScalarRel<MoneyUnit,FloatMoney>
FloatScalar.Rel<MoneyUnit> value = new FloatScalar.Rel<MoneyUnit>(100.0, MoneyUnit.SI);we can now write:
FloatMoney value = new FloatMoney(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-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, by $Author: averbraeck $,
initial version Sep 5, 2015
si
Constructor and Description |
---|
FloatMoney(double value,
MoneyUnit unit)
Construct FloatMoney scalar using a double value.
|
FloatMoney(FloatMoney value)
Construct FloatMoney scalar.
|
FloatMoney(float value,
MoneyUnit unit)
Construct FloatMoney scalar.
|
Modifier and Type | Method and Description |
---|---|
FloatMoneyPerArea |
divideBy(FloatArea v)
Calculate the division of FloatMoney and FloatArea, which results in a FloatMoneyPerArea scalar.
|
FloatMoneyPerDuration |
divideBy(FloatDuration v)
Calculate the division of FloatMoney and FloatDuration, which results in a FloatMoneyPerDuration scalar.
|
FloatMoneyPerEnergy |
divideBy(FloatEnergy v)
Calculate the division of FloatMoney and FloatEnergy, which results in a FloatMoneyPerEnergy scalar.
|
FloatMoneyPerLength |
divideBy(FloatLength v)
Calculate the division of FloatMoney and FloatLength, which results in a FloatMoneyPerLength scalar.
|
FloatMoneyPerMass |
divideBy(FloatMass v)
Calculate the division of FloatMoney and FloatMass, which results in a FloatMoneyPerMass scalar.
|
FloatDimensionless |
divideBy(FloatMoney v)
Calculate the division of FloatMoney and FloatMoney, which results in a FloatDimensionless scalar.
|
FloatMoneyPerVolume |
divideBy(FloatVolume v)
Calculate the division of FloatMoney and FloatVolume, which results in a FloatMoneyPerVolume scalar.
|
FloatMoney |
instantiateRel(float value,
MoneyUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatMoney |
interpolate(FloatMoney zero,
FloatMoney one,
float ratio)
Interpolate between two values.
|
static FloatMoney |
max(FloatMoney r1,
FloatMoney r2)
Return the maximum value of two monetary scalars.
|
static FloatMoney |
max(FloatMoney r1,
FloatMoney r2,
FloatMoney... rn)
Return the maximum value of more than two monetary scalars.
|
static FloatMoney |
min(FloatMoney r1,
FloatMoney r2)
Return the minimum value of two monetary scalars.
|
static FloatMoney |
min(FloatMoney r1,
FloatMoney r2,
FloatMoney... rn)
Return the minimum value of more than two monetary scalars.
|
FloatMoneyPerDuration |
multiplyBy(FloatFrequency v)
Calculate the multiplication of FloatMoney and FloatFrequency, which results in a FloatMoneyPerDuration scalar.
|
FloatMoneyPerLength |
multiplyBy(FloatLinearDensity v)
Calculate the multiplication of FloatMoney and FloatLinearDensity, which results in a FloatMoneyPerLength 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 FloatMoney(float value, MoneyUnit unit)
value
- float valueunit
- unit for the float valuepublic FloatMoney(FloatMoney value)
value
- Scalar from which to construct this instancepublic FloatMoney(double value, MoneyUnit unit)
value
- double valueunit
- unit for the resulting float valuepublic final FloatMoney instantiateRel(float value, MoneyUnit unit)
instantiateRel
in class AbstractFloatScalarRel<MoneyUnit,FloatMoney>
value
- the float valueunit
- the unitpublic static FloatMoney interpolate(FloatMoney zero, FloatMoney one, float ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static FloatMoney max(FloatMoney r1, FloatMoney r2)
r1
- the first scalarr2
- the second scalarpublic static FloatMoney max(FloatMoney r1, FloatMoney r2, FloatMoney... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatMoney min(FloatMoney r1, FloatMoney r2)
r1
- the first scalarr2
- the second scalarpublic static FloatMoney min(FloatMoney r1, FloatMoney r2, FloatMoney... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic final FloatDimensionless divideBy(FloatMoney v)
v
- FloatMoney scalarpublic final FloatMoneyPerArea divideBy(FloatArea v)
v
- FloatMoney scalarpublic final FloatMoneyPerEnergy divideBy(FloatEnergy v)
v
- FloatMoney scalarpublic final FloatMoneyPerLength divideBy(FloatLength v)
v
- FloatMoney scalarpublic final FloatMoneyPerLength multiplyBy(FloatLinearDensity v)
v
- FloatMoney scalarpublic final FloatMoneyPerMass divideBy(FloatMass v)
v
- FloatMoney scalarpublic final FloatMoneyPerDuration divideBy(FloatDuration v)
v
- FloatMoney scalarpublic final FloatMoneyPerDuration multiplyBy(FloatFrequency v)
v
- FloatMoney scalarpublic final FloatMoneyPerVolume divideBy(FloatVolume v)
v
- FloatMoney scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.