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