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