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-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 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.
|
si
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.
|
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 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; double valueunit
- SpeedUnit; unit for the double valuepublic Speed(Speed value)
value
- Speed; 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; double value in SI unitspublic static Speed interpolate(Speed zero, Speed one, double ratio)
zero
- Speed; the low valueone
- Speed; the high valueratio
- double; the ratio between 0 and 1, inclusivepublic static Speed max(Speed r1, Speed r2)
r1
- Speed; the first scalarr2
- Speed; the second scalarpublic static Speed max(Speed r1, Speed r2, Speed... rn)
r1
- Speed; the first scalarr2
- Speed; the second scalarrn
- Speed...; the other scalarspublic static Speed min(Speed r1, Speed r2)
r1
- Speed; the first scalarr2
- Speed; the second scalarpublic static Speed min(Speed r1, Speed r2, Speed... rn)
r1
- Speed; the first scalarr2
- Speed; the second scalarrn
- Speed...; the other scalarspublic final Dimensionless divideBy(Speed v)
v
- Speed; Speed scalarpublic final FlowVolume multiplyBy(Area v)
v
- Area; Speed scalarpublic final Power multiplyBy(Force v)
v
- Force; Speed scalarpublic final Acceleration multiplyBy(Frequency v)
v
- Frequency; Speed scalarpublic final Frequency divideBy(Length v)
v
- Length; Speed scalarpublic final Length divideBy(Frequency v)
v
- Frequency; Speed scalarpublic final Frequency multiplyBy(LinearDensity v)
v
- LinearDensity; Speed scalarpublic final Length multiplyBy(Duration v)
v
- Duration; Speed scalarpublic final Acceleration divideBy(Duration v)
v
- Duration; Speed scalarpublic final Duration divideBy(Acceleration v)
v
- Acceleration; Speed scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.