public class FloatEnergy extends AbstractFloatScalarRel<EnergyUnit,FloatEnergy>
FloatScalar.Rel<EnergyUnit> value = new FloatScalar.Rel<EnergyUnit>(100.0, EnergyUnit.SI);we can now write:
FloatEnergy value = new FloatEnergy(100.0, EnergyUnit.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-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, by $Author: averbraeck $,
initial version Sep 5, 2015
Modifier and Type | Field and Description |
---|---|
static FloatEnergy |
NaN
constant with value NaN.
|
static FloatEnergy |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static FloatEnergy |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static FloatEnergy |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static FloatEnergy |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static FloatEnergy |
ZERO
constant with value zero.
|
si
Constructor and Description |
---|
FloatEnergy(double value,
EnergyUnit unit)
Construct FloatEnergy scalar using a double value.
|
FloatEnergy(FloatEnergy value)
Construct FloatEnergy scalar.
|
FloatEnergy(float value,
EnergyUnit unit)
Construct FloatEnergy scalar.
|
Modifier and Type | Method and Description |
---|---|
static FloatEnergy |
createSI(float value)
Construct FloatEnergy scalar.
|
FloatPower |
divideBy(FloatDuration v)
Calculate the division of FloatEnergy and FloatDuration, which results in a FloatPower scalar.
|
FloatDimensionless |
divideBy(FloatEnergy v)
Calculate the division of FloatEnergy and FloatEnergy, which results in a FloatDimensionless scalar.
|
FloatLength |
divideBy(FloatForce v)
Calculate the division of FloatEnergy and FloatForce, which results in a FloatLength scalar.
|
FloatForce |
divideBy(FloatLength v)
Calculate the division of FloatEnergy and FloatLength, which results in a FloatForce scalar.
|
FloatDuration |
divideBy(FloatPower v)
Calculate the division of FloatEnergy and FloatPower, which results in a FloatDuration scalar.
|
FloatPressure |
divideBy(FloatVolume v)
Calculate the division of FloatEnergy and FloatVolume, which results in a FloatPressure scalar.
|
FloatEnergy |
instantiateRel(float value,
EnergyUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
static FloatEnergy |
interpolate(FloatEnergy zero,
FloatEnergy one,
float ratio)
Interpolate between two values.
|
static FloatEnergy |
max(FloatEnergy r1,
FloatEnergy r2)
Return the maximum value of two relative scalars.
|
static FloatEnergy |
max(FloatEnergy r1,
FloatEnergy r2,
FloatEnergy... rn)
Return the maximum value of more than two relative scalars.
|
static FloatEnergy |
min(FloatEnergy r1,
FloatEnergy r2)
Return the minimum value of two relative scalars.
|
static FloatEnergy |
min(FloatEnergy r1,
FloatEnergy r2,
FloatEnergy... rn)
Return the minimum value of more than two relative scalars.
|
FloatPower |
multiplyBy(FloatFrequency v)
Calculate the multiplication of FloatEnergy and FloatFrequency, which results in a FloatPower scalar.
|
FloatForce |
multiplyBy(FloatLinearDensity v)
Calculate the multiplication of FloatEnergy and FloatLinearDensity, which results in a FloatForce scalar.
|
FloatMoney |
multiplyBy(FloatMoneyPerEnergy v)
Calculate the multiplication of FloatEnergy and FloatMoneyPerEnergy, which results in a FloatMoney 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 FloatEnergy ZERO
public static final FloatEnergy NaN
public static final FloatEnergy POSITIVE_INFINITY
public static final FloatEnergy NEGATIVE_INFINITY
public static final FloatEnergy POS_MAXVALUE
public static final FloatEnergy NEG_MAXVALUE
public FloatEnergy(float value, EnergyUnit unit)
value
- float valueunit
- unit for the float valuepublic FloatEnergy(FloatEnergy value)
value
- Scalar from which to construct this instancepublic FloatEnergy(double value, EnergyUnit unit)
value
- double valueunit
- unit for the resulting float valuepublic final FloatEnergy instantiateRel(float value, EnergyUnit unit)
instantiateRel
in class AbstractFloatScalarRel<EnergyUnit,FloatEnergy>
value
- the float valueunit
- the unitpublic static final FloatEnergy createSI(float value)
value
- float value in SI unitspublic static FloatEnergy interpolate(FloatEnergy zero, FloatEnergy one, float ratio)
zero
- the low valueone
- the high valueratio
- the ratio between 0 and 1, inclusivepublic static FloatEnergy max(FloatEnergy r1, FloatEnergy r2)
r1
- the first scalarr2
- the second scalarpublic static FloatEnergy max(FloatEnergy r1, FloatEnergy r2, FloatEnergy... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic static FloatEnergy min(FloatEnergy r1, FloatEnergy r2)
r1
- the first scalarr2
- the second scalarpublic static FloatEnergy min(FloatEnergy r1, FloatEnergy r2, FloatEnergy... rn)
r1
- the first scalarr2
- the second scalarrn
- the other scalarspublic final FloatDimensionless divideBy(FloatEnergy v)
v
- FloatEnergy scalarpublic final FloatLength divideBy(FloatForce v)
v
- FloatEnergy scalarpublic final FloatForce divideBy(FloatLength v)
v
- FloatEnergy scalarpublic final FloatForce multiplyBy(FloatLinearDensity v)
v
- FloatEnergy scalarpublic final FloatPower divideBy(FloatDuration v)
v
- FloatEnergy scalarpublic final FloatDuration divideBy(FloatPower v)
v
- FloatEnergy scalarpublic final FloatPressure divideBy(FloatVolume v)
v
- FloatEnergy scalarpublic final FloatPower multiplyBy(FloatFrequency v)
v
- FloatEnergy scalarpublic final FloatMoney multiplyBy(FloatMoneyPerEnergy v)
v
- FloatEnergy scalarCopyright © 2015–2018 Delft University of Technology. All rights reserved.