public class Speed extends AbstractDoubleScalarRel<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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2019-03-03 00:53:50 +0100 (Sun, 03 Mar 2019) $, @version $Revision: 349 $, by $Author: averbraeck $,
initial version Sep 5, 2015
| Modifier and Type | Field and Description |
|---|---|
static Speed |
NaN
constant with value NaN.
|
static Speed |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static Speed |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static Speed |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static Speed |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static Speed |
ZERO
constant with value zero.
|
siNUMBER_PATTERN| Constructor and Description |
|---|
Speed(double value,
SpeedUnit unit)
Construct Speed scalar.
|
Speed(Speed value)
Construct Speed scalar.
|
| Modifier and Type | Method and Description |
|---|---|
static Speed |
createSI(double value)
Construct Speed scalar.
|
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.
|
Speed |
instantiateRel(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.
|
static Speed |
valueOf(String text)
Returns a Speed representation of a textual representation of a value with a unit.
|
abs, ceil, divideBy, floor, minus, multiplyBy, neg, plus, rint, roundcompareTo, doubleValue, eq, eq0, equals, floatValue, ge, ge0, getInUnit, getInUnit, getSI, gt, gt0, hashCode, intValue, le, le0, longValue, lt, lt0, ne, ne0, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocalebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final Speed ZERO
public static final Speed NaN
public static final Speed POSITIVE_INFINITY
public static final Speed NEGATIVE_INFINITY
public static final Speed POS_MAXVALUE
public static final Speed NEG_MAXVALUE
public Speed(double value,
SpeedUnit unit)
value - double valueunit - unit for the double valuepublic Speed(Speed value)
value - Scalar from which to construct this instancepublic final Speed instantiateRel(double value, SpeedUnit unit)
instantiateRel in class AbstractDoubleScalarRel<SpeedUnit,Speed>value - double; the double valueunit - U; the unitpublic static final Speed createSI(double value)
value - double value in SI unitspublic 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 static Speed valueOf(String text) throws IllegalArgumentException
text - String; the textual representation to parse into a SpeedIllegalArgumentException - when the text cannot be parsedpublic 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–2019 Delft University of Technology. All rights reserved.