RecordsFormat Class Reference
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 |
Converts an records format identifier to string.
s = RecordsFormat.int2str(i)
returns a string with the records format name for the given records format identifieri
. Ifi
is an invalid identifier, this function returns"unknown"
.
Example:
s = RecordsFormat.int2str(RecordsFormat.DENSE_MATRIX)
s
equals "dense_matrix"
◆ isValid()
|
static |
Checks if a records format name or identifier is valid.
b = RecordsFormat.isValid(s)
returnstrue
ifs
is a valid records format name or records format identifier andfalse
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 |
Converts an records format name to an identifier.
i = RecordsFormat.str2int(s)
returns an integer identifier for the given records format names
. Ifs
is an invalid format name, this function returnsRecordsFormat.UNKNOWN
.
Example:
i = RecordsFormat.str2int('dense_matrix')
i
equals RecordsFormat.DENSE_MATRIX