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-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 |
---|
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; float valueunit
- MoneyUnit; unit for the float valuepublic FloatMoney(FloatMoney value)
value
- FloatMoney; Scalar from which to construct this instancepublic FloatMoney(double value, MoneyUnit unit)
value
- double; double valueunit
- MoneyUnit; unit for the resulting float valuepublic final FloatMoney instantiateRel(float value, MoneyUnit unit)
instantiateRel
in class AbstractFloatScalarRel<MoneyUnit,FloatMoney>
value
- float; the float valueunit
- U; the unitpublic static FloatMoney interpolate(FloatMoney zero, FloatMoney one, float ratio)
zero
- FloatMoney; the low valueone
- FloatMoney; the high valueratio
- float; the ratio between 0 and 1, inclusivepublic static FloatMoney max(FloatMoney r1, FloatMoney r2)
r1
- FloatMoney; the first scalarr2
- FloatMoney; the second scalarpublic static FloatMoney max(FloatMoney r1, FloatMoney r2, FloatMoney... rn)
r1
- FloatMoney; the first scalarr2
- FloatMoney; the second scalarrn
- FloatMoney...; the other scalarspublic static FloatMoney min(FloatMoney r1, FloatMoney r2)
r1
- FloatMoney; the first scalarr2
- FloatMoney; the second scalarpublic static FloatMoney min(FloatMoney r1, FloatMoney r2, FloatMoney... rn)
r1
- FloatMoney; the first scalarr2
- FloatMoney; the second scalarrn
- FloatMoney...; the other scalarspublic final FloatDimensionless divideBy(FloatMoney v)
v
- FloatMoney; FloatMoney scalarpublic final FloatMoneyPerArea divideBy(FloatArea v)
v
- FloatArea; FloatMoney scalarpublic final FloatMoneyPerEnergy divideBy(FloatEnergy v)
v
- FloatEnergy; FloatMoney scalarpublic final FloatMoneyPerLength divideBy(FloatLength v)
v
- FloatLength; FloatMoney scalarpublic final FloatMoneyPerLength multiplyBy(FloatLinearDensity v)
v
- FloatLinearDensity; FloatMoney scalarpublic final FloatMoneyPerMass divideBy(FloatMass v)
v
- FloatMass; FloatMoney scalarpublic final FloatMoneyPerDuration divideBy(FloatDuration v)
v
- FloatDuration; FloatMoney scalarpublic final FloatMoneyPerDuration multiplyBy(FloatFrequency v)
v
- FloatFrequency; FloatMoney scalarpublic final FloatMoneyPerVolume divideBy(FloatVolume v)
v
- FloatVolume; FloatMoney scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.