public class LinearDensity extends TypedDoubleScalarRel<LinearDensityUnit,LinearDensity>
DoubleScalar.Rel<LinearDensityUnit> value = new DoubleScalar.Rel<LinearDensityUnit>(100.0, LinearDensityUnit.SI);we can now write:
LinearDensity value = new LinearDensity(100.0, LinearDensityUnit.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
DoubleScalar.Abs<U extends Unit<U>>, DoubleScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
static LinearDensity |
ZERO
constant with value zero.
|
si| Constructor and Description |
|---|
LinearDensity(double value,
LinearDensityUnit unit)
Construct LinearDensity scalar.
|
LinearDensity(LinearDensity value)
Construct LinearDensity scalar.
|
| Modifier and Type | Method and Description |
|---|---|
Dimensionless |
divideBy(LinearDensity v)
Calculate the division of LinearDensity and LinearDensity, which results in a Dimensionless scalar.
|
protected LinearDensity |
instantiateTypeRel(double value,
LinearDensityUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static LinearDensity |
interpolate(LinearDensity zero,
LinearDensity one,
double ratio)
Interpolate between two values.
|
static LinearDensity |
max(LinearDensity r1,
LinearDensity r2)
Return the maximum value of two relative scalars.
|
static LinearDensity |
max(LinearDensity r1,
LinearDensity r2,
LinearDensity... rn)
Return the maximum value of more than two relative scalars.
|
static LinearDensity |
min(LinearDensity r1,
LinearDensity r2)
Return the minimum value of two relative scalars.
|
static LinearDensity |
min(LinearDensity r1,
LinearDensity r2,
LinearDensity... rn)
Return the minimum value of more than two relative scalars.
|
Length |
multiplyBy(Area v)
Calculate the multiplication of LinearDensity and Area, which results in a Length scalar.
|
Force |
multiplyBy(Energy v)
Calculate the multiplication of LinearDensity and Energy, which results in a Force scalar.
|
MoneyPerLength |
multiplyBy(Money v)
Calculate the multiplication of LinearDensity and Money, which results in a MoneyPerLength scalar.
|
Frequency |
multiplyBy(Speed v)
Calculate the multiplication of LinearDensity and Speed, which results in a Frequency 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 LinearDensity ZERO
public LinearDensity(double value,
LinearDensityUnit unit)
value - double valueunit - unit for the double valuepublic LinearDensity(LinearDensity value)
value - Scalar from which to construct this instanceprotected final LinearDensity instantiateTypeRel(double value, LinearDensityUnit unit)
instantiateTypeRel in class TypedDoubleScalarRel<LinearDensityUnit,LinearDensity>value - the double valueunit - the unitpublic static LinearDensity interpolate(LinearDensity zero, LinearDensity one, double ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static LinearDensity max(LinearDensity r1, LinearDensity r2)
r1 - the first scalarr2 - the second scalarpublic static LinearDensity max(LinearDensity r1, LinearDensity r2, LinearDensity... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static LinearDensity min(LinearDensity r1, LinearDensity r2)
r1 - the first scalarr2 - the second scalarpublic static LinearDensity min(LinearDensity r1, LinearDensity r2, LinearDensity... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic final Dimensionless divideBy(LinearDensity v)
v - LinearDensity scalarpublic final Length multiplyBy(Area v)
v - LinearDensity scalarpublic final Force multiplyBy(Energy v)
v - LinearDensity scalarpublic final Frequency multiplyBy(Speed v)
v - LinearDensity scalarpublic final MoneyPerLength multiplyBy(Money v)
v - LinearDensity scalarCopyright © 2015–2016 Delft University of Technology. All rights reserved.