ElectricCharge class final

Represents a quantity of electric charge.

Electric charge is a fundamental property of matter that causes it to experience a force in an electromagnetic field. The SI derived unit is the Coulomb (C), defined as the charge transported by a constant current of one ampere in one second.

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

ElectricCharge(double _value, ElectricChargeUnit _unit)
Creates a new ElectricCharge with a given value and unit.
const
ElectricCharge.from(Current current, Time time)
Creates an ElectricCharge from a Current flowing over a Time duration (Q = I * t).
factory

Properties

asAbcoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Abcoulombs (abC).
no setter
asAmpereHours ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Ampere-hours (Ah).
no setter
asCoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Coulombs (C).
no setter
asElementaryCharges ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Elementary Charges (e).
no setter
asKilocoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Kilocoulombs (kC).
no setter
asMicrocoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Microcoulombs (µC).
no setter
asMilliampereHours ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Milliampere-hours (mAh).
no setter
asMillicoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Millicoulombs (mC).
no setter
asNanocoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Nanocoulombs (nC).
no setter
asPicocoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Picocoulombs (pC).
no setter
asStatcoulombs ElectricCharge

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns a new ElectricCharge object representing this charge in Statcoulombs (statC).
no setter
hashCode int
Returns a hash code for this Quantity instance.
no setterinherited
inAbcoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Abcoulombs (abC).
no setter
inAmpereHours double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Ampere-hours (Ah).
no setter
inCoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Coulombs (C).
no setter
inElementaryCharges double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Elementary Charges (e).
no setter
inKilocoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Kilocoulombs (kC).
no setter
inMicrocoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Microcoulombs (µC).
no setter
inMilliampereHours double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Milliampere-hours (mAh).
no setter
inMillicoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Millicoulombs (mC).
no setter
inNanocoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Nanocoulombs (nC).
no setter
inPicocoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Picocoulombs (pC).
no setter
inStatcoulombs double

Available on ElectricCharge, provided by the ElectricChargeValueGetters extension

Returns the electric charge value in Statcoulombs (statC).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unit ElectricChargeUnit
Returns the unit of measurement associated with this quantity's original value.
no setterinherited
value double
Returns the numerical value of this quantity in its original unit.
no setterinherited

Methods

compareTo(Quantity<ElectricChargeUnit> other) int
Compares this quantity to another Quantity of the same type (T).
inherited
convertTo(ElectricChargeUnit targetUnit) ElectricCharge
Creates a new Q instance with the value converted to targetUnit.
inherited
create(double value, ElectricChargeUnit unit) ElectricCharge
Factory that creates a new instance of the concrete subtype Q.
override
currentOver(Time time) Current
Calculates the Current if this charge flows over a given Time (I = Q / t).
getValue(ElectricChargeUnit targetUnit) double
Returns the value of this quantity converted to targetUnit.
inherited
isEquivalentTo(Quantity<ElectricChargeUnit> other, {double tolerance = 1e-9, double absoluteTolerance = 0.0}) bool
Checks if this quantity has the same physical magnitude as another, accounting for IEEE 754 floating-point rounding inaccuracies.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ratioTo(Quantity<ElectricChargeUnit> other) double
Computes the dimensionless ratio of this quantity to other.
inherited
timeFor(Current current) Time
Calculates the Time it takes for this charge to flow at a given Current (t = Q / I).
toString({ElectricChargeUnit? targetUnit, QuantityFormat format = QuantityFormat.invariant}) String
Returns a string representation of this quantity.
inherited

Operators

operator *(double scalar) ElectricCharge
Multiplies this quantity by a dimensionless scalar.
inherited
operator +(ElectricCharge other) ElectricCharge
Adds other to this quantity.
inherited
operator -(ElectricCharge other) ElectricCharge
Subtracts other from this quantity.
inherited
operator /(double scalar) ElectricCharge
Divides this quantity by a dimensionless scalar.
inherited
operator <(Quantity<ElectricChargeUnit> other) bool
Checks if this quantity's magnitude is less than another's.
inherited
operator <=(Quantity<ElectricChargeUnit> other) bool
Checks if this quantity's magnitude is less than or equal to another's.
inherited
operator ==(Object other) bool
Determines whether this Quantity is equal to another Object.
inherited
operator >(Quantity<ElectricChargeUnit> other) bool
Checks if this quantity's magnitude is greater than another's.
inherited
operator >=(Quantity<ElectricChargeUnit> other) bool
Checks if this quantity's magnitude is greater than or equal to another's.
inherited
operator unary-() ElectricCharge
Negates this quantity.
inherited

Static Properties

parser QuantityParser<ElectricChargeUnit, ElectricCharge>
The parser instance used to convert strings into ElectricCharge objects.
final

Static Methods

parse(String input, {List<QuantityFormat> formats = const [QuantityFormat.invariant]}) ElectricCharge
Parses a string representation of electric charge into an ElectricCharge object.
tryParse(String input, {List<QuantityFormat> formats = const [QuantityFormat.invariant]}) ElectricCharge?
Parses a string representation of electric charge into an ElectricCharge object, returning null when parsing fails.