public class ElectricalCharge extends TypedDoubleScalarRel<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-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2016-05-28 14:25:52 +0200 (Sat, 28 May 2016) $, @version $Revision: 202 $, by $Author: averbraeck $,
initial version Sep 5, 2015
DoubleScalar.Abs<U extends Unit<U>>, DoubleScalar.Rel<U extends Unit<U>>| Modifier and Type | Field and Description |
|---|---|
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 |
|---|---|
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.
|
protected ElectricalCharge |
instantiateTypeRel(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, plus, rint, roundcompareTo, eq, ge, getSI, gt, le, lt, minus, ne, plusdivide, divide, doubleValue, equals, floatValue, getInUnit, getInUnit, hashCode, interpolate, interpolate, intValue, longValue, minus, minus, minus, multiply, multiply, plus, plus, plus, toString, toString, toString, toStringexpressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelativebyteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitDIV, MULT, POWpublic static final ElectricalCharge ZERO
public ElectricalCharge(double value,
ElectricalChargeUnit unit)
value - double valueunit - unit for the double valuepublic ElectricalCharge(ElectricalCharge value)
value - Scalar from which to construct this instanceprotected final ElectricalCharge instantiateTypeRel(double value, ElectricalChargeUnit unit)
instantiateTypeRel in class TypedDoubleScalarRel<ElectricalChargeUnit,ElectricalCharge>value - the double valueunit - the unitpublic static ElectricalCharge interpolate(ElectricalCharge zero, ElectricalCharge one, double ratio)
zero - the low valueone - the high valueratio - the ratio between 0 and 1, inclusivepublic static ElectricalCharge max(ElectricalCharge r1, ElectricalCharge r2)
r1 - the first scalarr2 - the second scalarpublic static ElectricalCharge max(ElectricalCharge r1, ElectricalCharge r2, ElectricalCharge... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic static ElectricalCharge min(ElectricalCharge r1, ElectricalCharge r2)
r1 - the first scalarr2 - the second scalarpublic static ElectricalCharge min(ElectricalCharge r1, ElectricalCharge r2, ElectricalCharge... rn)
r1 - the first scalarr2 - the second scalarrn - the other scalarspublic final Dimensionless divideBy(ElectricalCharge v)
v - ElectricalCharge scalarpublic final ElectricalCurrent divideBy(Duration v)
v - ElectricalCharge scalarpublic final Duration divideBy(ElectricalCurrent v)
v - ElectricalCharge scalarCopyright © 2015–2016 Delft University of Technology. All rights reserved.