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