public class ElectricalCharge extends AbstractDoubleScalarRel<ElectricalChargeUnit,ElectricalCharge>
DoubleScalar.Rel<ElectricalChargeUnit> value = new DoubleScalar.Rel<ElectricalChargeUnit>(100.0, ElectricalChargeUnit.SI);we can now write:
ElectricalCharge value = new ElectricalCharge(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-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 ElectricalCharge |
NaN
constant with value NaN.
|
static ElectricalCharge |
NEG_MAXVALUE
constant with value -MAX_VALUE.
|
static ElectricalCharge |
NEGATIVE_INFINITY
constant with value NEGATIVE_INFINITY.
|
static ElectricalCharge |
POS_MAXVALUE
constant with value MAX_VALUE.
|
static ElectricalCharge |
POSITIVE_INFINITY
constant with value POSITIVE_INFINITY.
|
static ElectricalCharge |
ZERO
constant with value zero.
|
si
Constructor and Description |
---|
ElectricalCharge(double value,
ElectricalChargeUnit unit)
Construct ElectricalCharge scalar.
|
ElectricalCharge(ElectricalCharge value)
Construct ElectricalCharge scalar.
|
Modifier and Type | Method and Description |
---|---|
static ElectricalCharge |
createSI(double value)
Construct ElectricalCharge scalar.
|
ElectricalCurrent |
divideBy(Duration v)
Calculate the division of ElectricalCharge and Duration, which results in a ElectricalCurrent scalar.
|
Dimensionless |
divideBy(ElectricalCharge v)
Calculate the division of ElectricalCharge and ElectricalCharge, which results in a Dimensionless scalar.
|
Duration |
divideBy(ElectricalCurrent v)
Calculate the division of ElectricalCharge and ElectricalCurrent, which results in a Duration scalar.
|
ElectricalCharge |
instantiateRel(double value,
ElectricalChargeUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
static ElectricalCharge |
interpolate(ElectricalCharge zero,
ElectricalCharge one,
double ratio)
Interpolate between two values.
|
static ElectricalCharge |
max(ElectricalCharge r1,
ElectricalCharge r2)
Return the maximum value of two relative scalars.
|
static ElectricalCharge |
max(ElectricalCharge r1,
ElectricalCharge r2,
ElectricalCharge... rn)
Return the maximum value of more than two relative scalars.
|
static ElectricalCharge |
min(ElectricalCharge r1,
ElectricalCharge r2)
Return the minimum value of two relative scalars.
|
static ElectricalCharge |
min(ElectricalCharge r1,
ElectricalCharge r2,
ElectricalCharge... rn)
Return the minimum value of more than two relative scalars.
|
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 ElectricalCharge ZERO
public static final ElectricalCharge NaN
public static final ElectricalCharge POSITIVE_INFINITY
public static final ElectricalCharge NEGATIVE_INFINITY
public static final ElectricalCharge POS_MAXVALUE
public static final ElectricalCharge NEG_MAXVALUE
public ElectricalCharge(double value, ElectricalChargeUnit unit)
value
- double; double valueunit
- ElectricalChargeUnit; unit for the double valuepublic ElectricalCharge(ElectricalCharge value)
value
- ElectricalCharge; Scalar from which to construct this instancepublic final ElectricalCharge instantiateRel(double value, ElectricalChargeUnit unit)
instantiateRel
in class AbstractDoubleScalarRel<ElectricalChargeUnit,ElectricalCharge>
value
- double; the double valueunit
- U; the unitpublic static final ElectricalCharge createSI(double value)
value
- double; double value in SI unitspublic static ElectricalCharge interpolate(ElectricalCharge zero, ElectricalCharge one, double ratio)
zero
- ElectricalCharge; the low valueone
- ElectricalCharge; the high valueratio
- double; the ratio between 0 and 1, inclusivepublic static ElectricalCharge max(ElectricalCharge r1, ElectricalCharge r2)
r1
- ElectricalCharge; the first scalarr2
- ElectricalCharge; the second scalarpublic static ElectricalCharge max(ElectricalCharge r1, ElectricalCharge r2, ElectricalCharge... rn)
r1
- ElectricalCharge; the first scalarr2
- ElectricalCharge; the second scalarrn
- ElectricalCharge...; the other scalarspublic static ElectricalCharge min(ElectricalCharge r1, ElectricalCharge r2)
r1
- ElectricalCharge; the first scalarr2
- ElectricalCharge; the second scalarpublic static ElectricalCharge min(ElectricalCharge r1, ElectricalCharge r2, ElectricalCharge... rn)
r1
- ElectricalCharge; the first scalarr2
- ElectricalCharge; the second scalarrn
- ElectricalCharge...; the other scalarspublic final Dimensionless divideBy(ElectricalCharge v)
v
- ElectricalCharge; ElectricalCharge scalarpublic final ElectricalCurrent divideBy(Duration v)
v
- Duration; ElectricalCharge scalarpublic final Duration divideBy(ElectricalCurrent v)
v
- ElectricalCurrent; ElectricalCharge scalarCopyright © 2015–2019 Delft University of Technology. All rights reserved.