GAMSTransfer Records Formats. More...

GAMSTransfer Records Formats.

This class holds the possible GAMSTransfer formats of records similar to an enumeration class. Note that it is not an enumeration class due to compatibility (e.g. for Octave). See Records Format for more information.

Static Public Member Functions

static function int2str (in value_int)
 Converts an records format identifier to string. More...
 
static function str2int (in value_str)
 Converts an records format name to an identifier. More...
 
static function isValid (in value)
 Checks if a records format name or identifier is valid. More...
 

Public Attributes

Constant Property UNKNOWN = -1
 identifier for unknown records format
 
Constant Property EMPTY = 1
 identifier for empty records
 
Constant Property STRUCT = 2
 identifier for records format as struct
 
Constant Property DENSE_MATRIX = 3
 identifier for records format as dense matrix
 
Constant Property SPARSE_MATRIX = 4
 identifier for records format as sparse matrix
 
Constant Property TABLE = 5
 identifier for records format as table
 

Member Function Documentation

◆ int2str()

static function int2str ( in  value_int)
static

Converts an records format identifier to string.

  • s = RecordsFormat.int2str(i) returns a string with the records format name for the given records format identifier i. If i is an invalid identifier, this function returns "unknown".

Example:

s = RecordsFormat.int2str(RecordsFormat.DENSE_MATRIX)

s equals "dense_matrix"

◆ isValid()

static function isValid ( in  value)
static

Checks if a records format name or identifier is valid.

  • b = RecordsFormat.isValid(s) returns true if s is a valid records format name or records format identifier and false otherwise.

Example:

RecordsFormat.isValid('dense_matrix') % is true
RecordsFormat.isValid(RecordsFormat.DENSE_MATRIX) % is true
RecordsFormat.isValid('not_a_valid_name') % is false

◆ str2int()

static function str2int ( in  value_str)
static

Converts an records format name to an identifier.

  • i = RecordsFormat.str2int(s) returns an integer identifier for the given records format name s. If s is an invalid format name, this function returns RecordsFormat.UNKNOWN.

Example:

i = RecordsFormat.str2int('dense_matrix')

i equals RecordsFormat.DENSE_MATRIX