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