C# Class Grib.Api.GribValue

Encapsulates logic for encoding and decoding a value within a GRIB message.
Mostra file Open project: 0x1mason/GribApi.NET Class Usage Examples

Public Methods

Method Description
AsBytes ( ) : byte[]

Gets the key's value in bytes.

AsBytes ( byte newBytes ) : void

Sets the key's value in bytes.

AsDouble ( bool inDegrees = true ) : double

Gets the key's value.

AsDouble ( double newValue, bool inDegrees = true ) : void

Sets the key's value.

AsDoubleArray ( ) : double[]

Gets a copy of the key's array value. Changing the values of this array does not affect the owning message. Call ::AsXArray(alteredArray) to set new values.

AsDoubleArray ( double newValues, bool force = false ) : void

Sets the key's value.

AsInt ( ) : int

Gets the key's value.

AsInt ( int newValue ) : void

Sets the key's value.

AsIntArray ( ) : int[]

Gets a copy of the key's array value. Changing the values of this array does not affect the owning message. Call ::AsXArray(alteredArray) to set new values.

AsIntArray ( int newValues ) : void

Sets the key's value.

AsString ( bool inDegrees = true ) : string

Gets the key's value.

AsString ( string newValue ) : void

Sets the key's value.

ToString ( ) : string

Returns a System.String that represents the value as a string.

Protected Methods

Method Description
BuildTokenForDouble ( bool inDegrees ) : string

Builds the token for accesing/mutating double values, accounting for degree conversions.

Private Methods

Method Description
AssertTypeSafe ( GribValueType requestedType ) : void

Tests for type safety when accessing this value.

AssertTypeSafe ( string key, GribValueType requestedType, GribValueType actualType ) : void

Tests for type safety when accessing a GRIB value.

GribValue ( GribHandle handle, string keyName ) : System

Initializes a new instance of the GribValue class.

GribValue ( string keyName ) : System

Initializes a new instance of the GribValue class.

NativeTypeForKey ( string key ) : GribValueType

Gets an enum describing a key's representation within the message.

Method Details

AsBytes() public method

Gets the key's value in bytes.
public AsBytes ( ) : byte[]
return byte[]

AsBytes() public method

Sets the key's value in bytes.
public AsBytes ( byte newBytes ) : void
newBytes byte The new bytes.
return void

AsDouble() public method

Gets the key's value.
public AsDouble ( bool inDegrees = true ) : double
inDegrees bool if set to true, GribApi.NET will return the value [in degrees] when possible.
return double

AsDouble() public method

Sets the key's value.
public AsDouble ( double newValue, bool inDegrees = true ) : void
newValue double The new value.
inDegrees bool if set to true [in degrees], GribApi.NET will set the value [in degrees] when possible.
return void

AsDoubleArray() public method

Gets a copy of the key's array value. Changing the values of this array does not affect the owning message. Call ::AsXArray(alteredArray) to set new values.
public AsDoubleArray ( ) : double[]
return double[]

AsDoubleArray() public method

Sets the key's value.
public AsDoubleArray ( double newValues, bool force = false ) : void
newValues double The new values.
force bool if set to true [force].
return void

AsInt() public method

Gets the key's value.
public AsInt ( ) : int
return int

AsInt() public method

Sets the key's value.
public AsInt ( int newValue ) : void
newValue int The new value.
return void

AsIntArray() public method

Gets a copy of the key's array value. Changing the values of this array does not affect the owning message. Call ::AsXArray(alteredArray) to set new values.
public AsIntArray ( ) : int[]
return int[]

AsIntArray() public method

Sets the key's value.
public AsIntArray ( int newValues ) : void
newValues int The new values.
return void

AsString() public method

Gets the key's value.
public AsString ( bool inDegrees = true ) : string
inDegrees bool if set to true, GribApi.NET will convert the value to degrees when possible.
return string

AsString() public method

Sets the key's value.
public AsString ( string newValue ) : void
newValue string The new value.
return void

BuildTokenForDouble() protected method

Builds the token for accesing/mutating double values, accounting for degree conversions.
protected BuildTokenForDouble ( bool inDegrees ) : string
inDegrees bool if set to true [in degrees].
return string

ToString() public method

Returns a System.String that represents the value as a string.
public ToString ( ) : string
return string