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