public class FloatDensity extends TypedFloatScalarRel<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-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2016-05-28 14:25:52 +0200 (Sat, 28 May 2016) $, @version $Revision: 202 $, by $Author: averbraeck $,
initial version Sep 5, 2015
FloatScalar.Abs<U extends Unit<U>>, FloatScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
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 |
|---|---|
FloatDimensionless |
divideBy(FloatDensity v)
Calculate the division of FloatDensity and FloatDensity, which results in a FloatDimensionless scalar.
|
protected FloatDensity |
instantiateTypeRel(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, plus, rint, roundcompareTo, eq, ge, getSI, gt, le, lt, minus, ne, plusdivide, divide, doubleValue, equals, floatValue, getInUnit, getInUnit, hashCode, interpolate, interpolate, intValue, longValue, minus, minus, minus, multiply, multiply, plus, plus, plus, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelativebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final FloatDensity ZERO
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 valueprotected final FloatDensity instantiateTypeRel(float value, DensityUnit unit)
instantiateTypeRel in class TypedFloatScalarRel<DensityUnit,FloatDensity>value - the float valueunit - the unitpublic 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 final FloatDimensionless divideBy(FloatDensity v)
v - FloatDensity scalarpublic final FloatMass multiplyBy(FloatVolume v)
v - FloatDensity scalarCopyright © 2015–2016 Delft University of Technology. All rights reserved.