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-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
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 valueunit
- unit for the float valuepublic FloatMass(FloatMass value)
value
- Scalar from which to construct this instancepublic FloatMass(double value, MassUnit unit)
value
- double valueunit
- unit for the resulting float valuepublic final FloatMass instantiateRel(float value, MassUnit unit)
instantiateRel
in class AbstractFloatScalarRel<MassUnit,FloatMass>
value
- the float valueunit
- the unitpublic static final FloatMass createSI(float value)
value
- float value in SI unitspublic static FloatMass interpolate(FloatMass zero, FloatMass one, float ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static FloatMass max(FloatMass r1, FloatMass r2)
r1
- the first scalarr2
- the second scalarpublic static FloatMass max(FloatMass r1, FloatMass r2, FloatMass... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatMass min(FloatMass r1, FloatMass r2)
r1
- the first scalarr2
- the second scalarpublic static FloatMass min(FloatMass r1, FloatMass r2, FloatMass... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic final FloatDimensionless divideBy(FloatMass v)
v
- FloatMass scalarpublic final FloatDuration divideBy(FloatFlowMass v)
v
- FloatMass scalarpublic final FloatFlowMass divideBy(FloatDuration v)
v
- FloatMass scalarpublic final FloatForce multiplyBy(FloatAcceleration v)
v
- FloatMass scalarpublic final FloatFlowMass multiplyBy(FloatFrequency v)
v
- FloatMass scalarpublic final FloatVolume divideBy(FloatDensity v)
v
- FloatMass scalarpublic final FloatDensity divideBy(FloatVolume v)
v
- FloatMass scalarpublic final FloatMoney multiplyBy(FloatMoneyPerMass v)
v
- FloatMass scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.