public class FloatSpeed extends AbstractFloatScalarRel<SpeedUnit,FloatSpeed>
FloatScalar.Rel<SpeedUnit> value = new FloatScalar.Rel<SpeedUnit>(100.0, SpeedUnit.SI);we can now write:
FloatSpeed value = new FloatSpeed(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 FloatSpeed |
NaN
constant with value NaN.
|
static FloatSpeed |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static FloatSpeed |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static FloatSpeed |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static FloatSpeed |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static FloatSpeed |
ZERO
constant with value zero.
|
si
NUMBER_PATTERN
Constructor and Description |
---|
FloatSpeed(double value,
SpeedUnit unit)
Construct FloatSpeed scalar using a double value.
|
FloatSpeed(FloatSpeed value)
Construct FloatSpeed scalar.
|
FloatSpeed(float value,
SpeedUnit unit)
Construct FloatSpeed scalar.
|
Modifier and Type | Method and Description |
---|---|
static FloatSpeed |
createSI(float value)
Construct FloatSpeed scalar.
|
FloatDuration |
divideBy(FloatAcceleration v)
Calculate the division of FloatSpeed and FloatAcceleration, which results in a FloatDuration scalar.
|
FloatAcceleration |
divideBy(FloatDuration v)
Calculate the division of FloatSpeed and FloatDuration, which results in a FloatAcceleration scalar.
|
FloatLength |
divideBy(FloatFrequency v)
Calculate the division of FloatSpeed and FloatFrequency, which results in a FloatLength scalar.
|
FloatFrequency |
divideBy(FloatLength v)
Calculate the division of FloatSpeed and FloatLength, which results in a FloatFrequency scalar.
|
FloatDimensionless |
divideBy(FloatSpeed v)
Calculate the division of FloatSpeed and FloatSpeed, which results in a FloatDimensionless scalar.
|
FloatSpeed |
instantiateRel(float value,
SpeedUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatSpeed |
interpolate(FloatSpeed zero,
FloatSpeed one,
float ratio)
Interpolate between two values.
|
static FloatSpeed |
max(FloatSpeed r1,
FloatSpeed r2)
Return the maximum value of two relative scalars.
|
static FloatSpeed |
max(FloatSpeed r1,
FloatSpeed r2,
FloatSpeed... rn)
Return the maximum value of more than two relative scalars.
|
static FloatSpeed |
min(FloatSpeed r1,
FloatSpeed r2)
Return the minimum value of two relative scalars.
|
static FloatSpeed |
min(FloatSpeed r1,
FloatSpeed r2,
FloatSpeed... rn)
Return the minimum value of more than two relative scalars.
|
FloatFlowVolume |
multiplyBy(FloatArea v)
Calculate the multiplication of FloatSpeed and FloatArea, which results in a FloatFlowVolume scalar.
|
FloatLength |
multiplyBy(FloatDuration v)
Calculate the multiplication of FloatSpeed and FloatDuration, which results in a FloatLength scalar.
|
FloatForce |
multiplyBy(FloatFlowMass v)
Calculate the multiplication of FloatSpeed and FloatFlowMass, which results in a FloatForce scalar.
|
FloatPower |
multiplyBy(FloatForce v)
Calculate the multiplication of FloatSpeed and FloatForce, which results in a FloatPower scalar.
|
FloatAcceleration |
multiplyBy(FloatFrequency v)
Calculate the multiplication of FloatSpeed and FloatFrequency, which results in a FloatAcceleration scalar.
|
FloatFrequency |
multiplyBy(FloatLinearDensity v)
Calculate the multiplication of FloatSpeed and FloatLinearDensity, which results in a FloatFrequency scalar.
|
static FloatSpeed |
valueOf(String text)
Returns a FloatSpeed representation of a textual representation of a value with a unit.
|
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, stringOf, stringOfDefaultLocale, textualStringOf, textualStringOfDefaultLocale
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
DIV, MULT, POW
public static final FloatSpeed ZERO
public static final FloatSpeed NaN
public static final FloatSpeed POSITIVE_INFINITY
public static final FloatSpeed NEGATIVE_INFINITY
public static final FloatSpeed POS_MAXVALUE
public static final FloatSpeed NEG_MAXVALUE
public FloatSpeed(float value, SpeedUnit unit)
value
- float valueunit
- unit for the float valuepublic FloatSpeed(FloatSpeed value)
value
- Scalar from which to construct this instancepublic FloatSpeed(double value, SpeedUnit unit)
value
- double valueunit
- unit for the resulting float valuepublic final FloatSpeed instantiateRel(float value, SpeedUnit unit)
instantiateRel
in class AbstractFloatScalarRel<SpeedUnit,FloatSpeed>
value
- float; the float valueunit
- U; the unitpublic static final FloatSpeed createSI(float value)
value
- float value in SI unitspublic static FloatSpeed interpolate(FloatSpeed zero, FloatSpeed one, float ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static FloatSpeed max(FloatSpeed r1, FloatSpeed r2)
r1
- the first scalarr2
- the second scalarpublic static FloatSpeed max(FloatSpeed r1, FloatSpeed r2, FloatSpeed... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatSpeed min(FloatSpeed r1, FloatSpeed r2)
r1
- the first scalarr2
- the second scalarpublic static FloatSpeed min(FloatSpeed r1, FloatSpeed r2, FloatSpeed... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatSpeed valueOf(String text) throws IllegalArgumentException
text
- String; the textual representation to parse into a FloatSpeedIllegalArgumentException
- when the text cannot be parsedpublic final FloatDimensionless divideBy(FloatSpeed v)
v
- FloatSpeed scalarpublic final FloatFlowVolume multiplyBy(FloatArea v)
v
- FloatSpeed scalarpublic final FloatPower multiplyBy(FloatForce v)
v
- FloatSpeed scalarpublic final FloatAcceleration multiplyBy(FloatFrequency v)
v
- FloatSpeed scalarpublic final FloatFrequency divideBy(FloatLength v)
v
- FloatSpeed scalarpublic final FloatLength divideBy(FloatFrequency v)
v
- FloatSpeed scalarpublic final FloatFrequency multiplyBy(FloatLinearDensity v)
v
- FloatSpeed scalarpublic final FloatLength multiplyBy(FloatDuration v)
v
- FloatSpeed scalarpublic final FloatAcceleration divideBy(FloatDuration v)
v
- FloatSpeed scalarpublic final FloatDuration divideBy(FloatAcceleration v)
v
- FloatSpeed scalarpublic final FloatForce multiplyBy(FloatFlowMass v)
v
- FloatSpeed scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.