Click or drag to resize

Charge Structure

Represents an electric charge measurement, in coulombs (i.e., ampere-seconds), as a double-precision floating-point number.
Inheritance Hierarchy
SystemObject
  SystemValueType
    GSF.UnitsCharge

Namespace: GSF.Units
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
View Source

The Charge type exposes the following members.

Constructors
 NameDescription
Public methodCharge Creates a new Charge.
Top
Methods
 NameDescription
Public methodCompareTo(Charge) Compares this instance to a specified Charge and returns an indication of their relative values.
Public methodCompareTo(Double) Compares this instance to a specified Double and returns an indication of their relative values.
Public methodCompareTo(Object) Compares this instance to a specified object and returns an indication of their relative values.
Public methodStatic memberConvertFrom Converts the value in the specified sourceUnit to a new Charge in coulombs.
Public methodConvertTo Converts the Charge to the specified targetUnit.
Public methodEquals(Charge) Returns a value indicating whether this instance is equal to a specified Charge value.
Public methodEquals(Double) Returns a value indicating whether this instance is equal to a specified Double value.
Public methodEquals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object))
Public methodStatic memberFromAbcoulombs Creates a new Charge value from the specified value in abcoulombs.
Public methodStatic memberFromAmpereHours Creates a new Charge value from the specified value in ampere-hours.
Public methodStatic memberFromAtomicUnitsOfCharge Creates a new Charge value from the specified value in atomic units of charge.
Public methodStatic memberFromFaraday Creates a new Charge value from the specified value in faraday.
Public methodStatic memberFromStatcoulombs Creates a new Charge value from the specified value in statcoulombs.
Public methodGetHashCode Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetTypeCode Returns the TypeCode for value type Double.
Public methodStatic memberParse(String) Converts the string representation of a number to its Charge equivalent.
Public methodStatic memberParse(String, NumberStyles) Converts the string representation of a number in a specified style to its Charge equivalent.
Public methodStatic memberParse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its Charge equivalent.
Public methodStatic memberParse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its Charge equivalent.
Public methodToAbcoulombs Gets the Charge value in abcoulombs.
Public methodToAmpereHours Gets the Energy value in ampere-hours.
Public methodToAtomicUnitsOfCharge Gets the Charge value in atomic units of charge.
Public methodToFaraday Gets the Charge value in faraday.
Public methodToStatcoulombs Gets the Charge value in statcoulombs.
Public methodToString Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String) Converts the numeric value of this instance to its equivalent string representation, using the specified format.
Public methodToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, Charge) Converts the string representation of a number to its Charge equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, NumberStyles, IFormatProvider, Charge) Converts the string representation of a number in a specified style and culture-specific format to its Charge equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Charge, Charge) Returns computed sum of values.
Public operatorStatic memberDivision(Charge, Charge) Returns computed division of values.
Public operatorStatic memberEquality(Charge, Charge) Compares the two values for equality.
Public operatorStatic memberExponent(Charge, Charge) Returns result of first value raised to charge of second value.
Public operatorStatic memberGreaterThan(Charge, Charge) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThanOrEqual(Charge, Charge) Returns true if left value is greater than or equal to right value.
Public operatorStatic member(Charge to Double) Implicitly converts Charge, represented in coulombs, to a Double.
Public operatorStatic member(Double to Charge) Implicitly converts value, represented in coulombs, to a Charge.
Public operatorStatic memberInequality(Charge, Charge) Compares the two values for inequality.
Public operatorStatic memberLessThan(Charge, Charge) Returns true if left value is less than right value.
Public operatorStatic memberLessThanOrEqual(Charge, Charge) Returns true if left value is less or equal to than right value.
Public operatorStatic memberModulus(Charge, Charge) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberMultiply(Charge, Charge) Returns computed product of values.
Public operatorStatic memberSubtraction(Charge, Charge) Returns computed difference of values.
Top
Fields
 NameDescription
Public fieldStatic memberMaxValueRepresents the largest possible value of an Charge. This field is constant.
Public fieldStatic memberMinValueRepresents the smallest possible value of an Charge. This field is constant.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
This class behaves just like a Double representing a charge in coulombs; it is implicitly castable to and from a Double and therefore can be generally used "as" a double, but it has the advantage of handling conversions to and from other charge representations, specifically ampere-hours, abcoulomb (a.k.a., an electromagnetic unit), statcoulomb (a.k.a., electrostatic unit or franklin), atomic unit of charge and faraday. Metric conversions are handled simply by applying the needed SI conversion factor, for example:
Example
Convert charge, in coulombs, to kilocoulombs:
C#
public double GetKilocoulombs(Charge coulombs)
{
    return coulombs / SI.Kilo;
}
See Also