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-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 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; float valueunit
- EnergyUnit; unit for the float valuepublic FloatEnergy(FloatEnergy value)
value
- FloatEnergy; Scalar from which to construct this instancepublic FloatEnergy(double value, EnergyUnit unit)
value
- double; double valueunit
- EnergyUnit; unit for the resulting float valuepublic final FloatEnergy instantiateRel(float value, EnergyUnit unit)
instantiateRel
in class AbstractFloatScalarRel<EnergyUnit,FloatEnergy>
value
- float; the float valueunit
- U; the unitpublic static final FloatEnergy createSI(float value)
value
- float; float value in SI unitspublic static FloatEnergy interpolate(FloatEnergy zero, FloatEnergy one, float ratio)
zero
- FloatEnergy; the low valueone
- FloatEnergy; the high valueratio
- float; the ratio between 0 and 1, inclusivepublic static FloatEnergy max(FloatEnergy r1, FloatEnergy r2)
r1
- FloatEnergy; the first scalarr2
- FloatEnergy; the second scalarpublic static FloatEnergy max(FloatEnergy r1, FloatEnergy r2, FloatEnergy... rn)
r1
- FloatEnergy; the first scalarr2
- FloatEnergy; the second scalarrn
- FloatEnergy...; the other scalarspublic static FloatEnergy min(FloatEnergy r1, FloatEnergy r2)
r1
- FloatEnergy; the first scalarr2
- FloatEnergy; the second scalarpublic static FloatEnergy min(FloatEnergy r1, FloatEnergy r2, FloatEnergy... rn)
r1
- FloatEnergy; the first scalarr2
- FloatEnergy; the second scalarrn
- FloatEnergy...; the other scalarspublic final FloatDimensionless divideBy(FloatEnergy v)
v
- FloatEnergy; FloatEnergy scalarpublic final FloatLength divideBy(FloatForce v)
v
- FloatForce; FloatEnergy scalarpublic final FloatForce divideBy(FloatLength v)
v
- FloatLength; FloatEnergy scalarpublic final FloatForce multiplyBy(FloatLinearDensity v)
v
- FloatLinearDensity; FloatEnergy scalarpublic final FloatPower divideBy(FloatDuration v)
v
- FloatDuration; FloatEnergy scalarpublic final FloatDuration divideBy(FloatPower v)
v
- FloatPower; FloatEnergy scalarpublic final FloatPressure divideBy(FloatVolume v)
v
- FloatVolume; FloatEnergy scalarpublic final FloatPower multiplyBy(FloatFrequency v)
v
- FloatFrequency; FloatEnergy scalarpublic final FloatMoney multiplyBy(FloatMoneyPerEnergy v)
v
- FloatMoneyPerEnergy; FloatEnergy scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.