Current class final
Represents a quantity of electric current.
Electric current is the rate of flow of electric charge. The SI base unit for electric current is the Ampere (A). It is a fundamental quantity in electrical engineering and physics.
This class provides a type-safe way to handle electric current values and conversions between different units (e.g., amperes, milliamperes, kiloamperes).
- Inheritance
-
- Object
- Quantity<
CurrentUnit> - LinearQuantity<
CurrentUnit, Current> - Current
- Available extensions
- Annotations
-
- @immutable
Constructors
- Current(double _value, CurrentUnit _unit)
-
Creates a new
Currentquantity with the given numerical value and unit.const
Properties
- asAbamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Abamperes (abA) or Biot (Bi).no setter - asAmperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Amperes (A).no setter - asFemtoamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Femtoamperes (fA).no setter - asGigaamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Gigaamperes (GA).no setter - asKiloamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Kiloamperes (kA).no setter - asMegaamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Megaamperes (MA).no setter - asMicroamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Microamperes (µA).no setter - asMilliamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Milliamperes (mA).no setter - asNanoamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Nanoamperes (nA).no setter - asPicoamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Picoamperes (pA).no setter - asStatamperes → Current
-
Available on Current, provided by the CurrentValueGetters extension
Returns a new Current object representing this current in Statamperes (statA).no setter - hashCode → int
-
Returns a hash code for this
Quantityinstance.no setterinherited - inAbamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Abamperes (abA) or Biot (Bi).no setter - inAmperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Amperes (A).no setter - inFemtoamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Femtoamperes (fA).no setter - inGigaamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Gigaamperes (GA).no setter - inKiloamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Kiloamperes (kA).no setter - inMegaamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Megaamperes (MA).no setter - inMicroamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Microamperes (µA).no setter - inMilliamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Milliamperes (mA).no setter - inNanoamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Nanoamperes (nA).no setter - inPicoamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Picoamperes (pA).no setter - inStatamperes → double
-
Available on Current, provided by the CurrentValueGetters extension
Returns the electric current value in Statamperes (statA).no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unit → CurrentUnit
-
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< CurrentUnit> other) → int -
Compares this quantity to another Quantity of the same type (
T).inherited -
convertTo(
CurrentUnit targetUnit) → Current -
Creates a new
Qinstance with the value converted totargetUnit.inherited -
create(
double value, CurrentUnit unit) → Current -
Factory that creates a new instance of the concrete subtype
Q.override -
getValue(
CurrentUnit targetUnit) → double -
Returns the value of this quantity converted to
targetUnit.inherited -
isEquivalentTo(
Quantity< CurrentUnit> 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< CurrentUnit> other) → double -
Computes the dimensionless ratio of this quantity to
other.inherited -
toString(
{CurrentUnit? targetUnit, QuantityFormat format = QuantityFormat.invariant}) → String -
Returns a string representation of this quantity.
inherited
Operators
-
operator *(
double scalar) → Current -
Multiplies this quantity by a dimensionless
scalar.inherited -
operator +(
Current other) → Current -
Adds
otherto this quantity.inherited -
operator -(
Current other) → Current -
Subtracts
otherfrom this quantity.inherited -
operator /(
double scalar) → Current -
Divides this quantity by a dimensionless
scalar.inherited -
operator <(
Quantity< CurrentUnit> other) → bool -
Checks if this quantity's magnitude is less than another's.
inherited
-
operator <=(
Quantity< CurrentUnit> 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< CurrentUnit> other) → bool -
Checks if this quantity's magnitude is greater than another's.
inherited
-
operator >=(
Quantity< CurrentUnit> other) → bool -
Checks if this quantity's magnitude is greater than or equal to another's.
inherited
-
operator unary-(
) → Current -
Negates this quantity.
inherited
Static Properties
-
parser
→ QuantityParser<
CurrentUnit, Current> -
The parser instance used to convert strings into Current objects.
final
Static Methods
-
parse(
String input, {List< QuantityFormat> formats = const [QuantityFormat.invariant]}) → Current - Parses a string representation of electric current into a Current object.
-
tryParse(
String input, {List< QuantityFormat> formats = const [QuantityFormat.invariant]}) → Current? -
Parses a string representation of electric current into a Current
object, returning
nullwhen parsing fails.