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