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