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-03-03 00:53:50 +0100 (Sun, 03 Mar 2019) $, @version $Revision: 349 $, 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.
|
siNUMBER_PATTERN| 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.
|
static FloatDensity |
valueOf(String text)
Returns a FloatDensity representation of a textual representation of a value with a unit.
|
abs, ceil, divideBy, floor, minus, multiplyBy, neg, plus, rint, roundcompareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocalebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic 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 valueunit - unit for the float valuepublic FloatDensity(FloatDensity value)
value - Scalar from which to construct this instancepublic FloatDensity(double value,
DensityUnit unit)
value - double valueunit - 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 value in SI unitspublic static FloatDensity interpolate(FloatDensity zero, FloatDensity one, float ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static FloatDensity max(FloatDensity r1, FloatDensity r2)
r1 - the first scalarr2 - the second scalarpublic static FloatDensity max(FloatDensity r1, FloatDensity r2, FloatDensity... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static FloatDensity min(FloatDensity r1, FloatDensity r2)
r1 - the first scalarr2 - the second scalarpublic static FloatDensity min(FloatDensity r1, FloatDensity r2, FloatDensity... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static FloatDensity valueOf(String text) throws IllegalArgumentException
text - String; the textual representation to parse into a FloatDensityIllegalArgumentException - when the text cannot be parsedpublic final FloatDimensionless divideBy(FloatDensity v)
v - FloatDensity scalarpublic final FloatMass multiplyBy(FloatVolume v)
v - FloatDensity scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.