Click or drag to resize

Volume Structure

Represents a volume measurement, in cubic meters, as a double-precision floating-point number.
Inheritance Hierarchy
SystemObject
  SystemValueType
    GSF.UnitsVolume

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

The Volume type exposes the following members.

Constructors
 NameDescription
Public methodVolume Creates a new Volume.
Top
Methods
 NameDescription
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 methodCompareTo(Volume) Compares this instance to a specified Volume and returns an indication of their relative values.
Public methodStatic memberConvertFrom Converts the value in the specified sourceUnit to a new Volume in cubic meters.
Public methodConvertTo Converts the Volume to the specified targetUnit.
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 methodEquals(Volume) Returns a value indicating whether this instance is equal to a specified Volume value.
Public methodStatic memberFromCubicFeet Creates a new Volume value from the specified value in cubic feet.
Public methodStatic memberFromCubicInches Creates a new Volume value from the specified value in cubic inches.
Public methodStatic memberFromCups Creates a new Volume value from the specified value in US cups.
Public methodStatic memberFromFluidOunces Creates a new Volume value from the specified value in US fluid ounces.
Public methodStatic memberFromGallons Creates a new Volume value from the specified value in US fluid gallons.
Public methodStatic memberFromLiters Creates a new Volume value from the specified value in liters.
Public methodStatic memberFromMetricCups Creates a new Volume value from the specified value in metric cups.
Public methodStatic memberFromMetricTablespoons Creates a new Volume value from the specified value in metric tablespoons.
Public methodStatic memberFromMetricTeaspoons Creates a new Volume value from the specified value in metric teaspoons.
Public methodStatic memberFromPints Creates a new Volume value from the specified value in US fluid pints.
Public methodStatic memberFromQuarts Creates a new Volume value from the specified value in US fluid quarts.
Public methodStatic memberFromTablespoons Creates a new Volume value from the specified value in US tablespoons.
Public methodStatic memberFromTeaspoons Creates a new Volume value from the specified value in US teaspoons.
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 Volume equivalent.
Public methodStatic memberParse(String, NumberStyles) Converts the string representation of a number in a specified style to its Volume equivalent.
Public methodStatic memberParse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its Volume equivalent.
Public methodStatic memberParse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its Volume equivalent.
Public methodToCubicFeet Gets the Volume value in cubic feet.
Public methodToCubicInches Gets the Volume value in cubic inches.
Public methodToCups Gets the Volume value in US cups.
Public methodToFluidOunces Gets the Volume value in US fluid ounces.
Public methodToGallons Gets the Volume value in US fluid gallons.
Public methodToLiters Gets the Volume value in liters.
Public methodToMetricCups Gets the Volume value in metric cups.
Public methodToMetricTablespoons Gets the Volume value in metric tablespoons.
Public methodToMetricTeaspoons Gets the Volume value in metric teaspoons.
Public methodToPints Gets the Volume value in US fluid pints.
Public methodToQuarts Gets the Volume value in US fluid quarts.
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 methodToTablespoons Gets the Volume value in US tablespoons.
Public methodToTeaspoons Gets the Volume value in US teaspoons.
Public methodStatic memberTryParse(String, Volume) Converts the string representation of a number to its Volume equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, NumberStyles, IFormatProvider, Volume) Converts the string representation of a number in a specified style and culture-specific format to its Volume equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Volume, Volume) Returns computed sum of values.
Public operatorStatic memberDivision(Volume, Volume) Returns computed division of values.
Public operatorStatic memberEquality(Volume, Volume) Compares the two values for equality.
Public operatorStatic memberExponent(Volume, Volume) Returns result of first value raised to volume of second value.
Public operatorStatic memberGreaterThan(Volume, Volume) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThanOrEqual(Volume, Volume) Returns true if left value is greater than or equal to right value.
Public operatorStatic member(Double to Volume) Implicitly converts value, represented in cubic meters, to a Volume.
Public operatorStatic member(Volume to Double) Implicitly converts Volume, represented in cubic meters, to a Double.
Public operatorStatic memberInequality(Volume, Volume) Compares the two values for inequality.
Public operatorStatic memberLessThan(Volume, Volume) Returns true if left value is less than right value.
Public operatorStatic memberLessThanOrEqual(Volume, Volume) Returns true if left value is less or equal to than right value.
Public operatorStatic memberModulus(Volume, Volume) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberMultiply(Volume, Volume) Returns computed product of values.
Public operatorStatic memberSubtraction(Volume, Volume) Returns computed difference of values.
Top
Fields
 NameDescription
Public fieldStatic memberMaxValueRepresents the largest possible value of an Volume. This field is constant.
Public fieldStatic memberMinValueRepresents the smallest possible value of an Volume. 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 volume in cubic meters; 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 volume representations, specifically liters, teaspoons, tablespoons, cubic inches, fluid ounces, cups, pints, quarts, gallons and cubic feet. Metric conversions are handled simply by applying the needed SI conversion factor, for example:
Example
Convert volume, in cubic meters, to cubic kilometers:
C#
public double GetCubicKilometers(Volume cubicmeters)
{
    return cubicmeters / SI.Kilo;
}
This example converts teaspoons to cups:
C#
public double GetCups(double teaspoons)
{
    return Volume.FromTeaspoons(teaspoons).ToCups();
}
This example converts liters to fluid ounces:
C#
public double GetFluidOunces(double liters)
{
    return Volume.FromLiters(liters).ToFluidOunces();
}
See Also