com.gams.api.GAMSSymbolRecord Class Referenceabstract

This is the representation of a single record of a GAMSSymbol instance. More...

Inheritance diagram for com.gams.api.GAMSSymbolRecord:
com.gams.api.GAMSEquationRecord com.gams.api.GAMSParameterRecord com.gams.api.GAMSSetRecord com.gams.api.GAMSVariableRecord

Public Member Functions

String [] getKeys ()
 Retrieve keys of this GAMSSymbolRecord instance. More...
 
String getKey (int index)
 Retrieve key of GAMSSymbolRecord on position index. More...
 
boolean equals (Object obj)
 Indicates whether some other object is "equal to" this one. More...
 
int hashCode ()
 Returns a hash code value for the object. More...
 
boolean isDisposed ()
 Inquire if this record has already been disposed. More...
 
void dispose ()
 Release external resources hold by non-java library. More...
 
boolean moveNext ()
 Iterate to next GAMSSymbolRecord of GAMSSymbol using the current criterion. More...
 
boolean movePrevious ()
 Iterate to previous GAMSSymbolRecord of GAMSSymbol using the current criterion. More...
 

Protected Member Functions

 GAMSSymbolRecord (GAMSSymbol<?> symbol, long ptr)
 Create a new GAMSSymbolRecord instance. More...
 
 GAMSSymbolRecord (GAMSSymbolRecord record)
 Create a new GAMSSymbolRecord instance. More...
 
void finalize () throws Throwable
 Release resources used by non-java library. More...
 

Detailed Description

This is the representation of a single record of a GAMSSymbol instance.

Derived classes are GAMSEquationRecord, GAMSParameterRecord, GAMSSetRecord and GAMSVariableRecord.

There are a number of methods to obtain several GAMSSymbolRecord instances with the same underlying data. The behavior of GAMSSymbolRecord is unspecified if the underlying data has been deleted in any other way.

See also
GAMSSymbol.findRecord(String...)
GAMSSymbol.mergeRecord(String...)
GAMSSymbol.addRecord(String...)
GAMSSymbol.deleteRecord(String...)
GAMSSymbol.getFirstRecord()
GAMSSymbol.getFirstRecord(String...)
GAMSSymbol.getLastRecord()
GAMSSymbol.getLastRecord(String...)
GAMSSymbolIterator.next()
GAMSSymbolIterator.remove()

Constructor & Destructor Documentation

◆ GAMSSymbolRecord() [1/2]

com.gams.api.GAMSSymbolRecord.GAMSSymbolRecord ( GAMSSymbol<?>  symbol,
long  ptr 
)
protected

Create a new GAMSSymbolRecord instance.

The constructor assumes that the GAMSDatabase instance is not disposed (resources are still available).

Parameters
symbolGAMSSymbol to initialize this instance from
ptrsymbol pointer to initialize this instance from
Exceptions
GAMSExceptionIf the GAMSDatabase instance of this symbol has already been disposed, therefore resources are no longer available.

◆ GAMSSymbolRecord() [2/2]

com.gams.api.GAMSSymbolRecord.GAMSSymbolRecord ( GAMSSymbolRecord  record)
protected

Create a new GAMSSymbolRecord instance.

The constructor assumes that the GAMSDatabase instance is not disposed (resources are still available).

Parameters
recordGAMSSymbolRecord to initialize this instance from
Exceptions
GAMSExceptionIf the GAMSDatabase instance of this symbol has already been disposed, therefore resources are no longer available.

Member Function Documentation

◆ dispose()

void com.gams.api.GAMSSymbolRecord.dispose ( )

Release external resources hold by non-java library.

A subsequent call on the object after disposed potentially causes an unexpected error or exception.

Call this method either when the object is no longer needed and/or when resource management is a critical issue in the application.

◆ equals()

boolean com.gams.api.GAMSSymbolRecord.equals ( Object  obj)

Indicates whether some other object is "equal to" this one.

The two GAMSSymbols are equivalent if and only if they are records of the same symbol and same internal reference.

Parameters
objthe reference object with which to compare
Returns
true if this object is the same as the obj argument; false otherwise.

◆ finalize()

void com.gams.api.GAMSSymbolRecord.finalize ( ) throws Throwable
protected

Release resources used by non-java library.

◆ getKey()

String com.gams.api.GAMSSymbolRecord.getKey ( int  index)

Retrieve key of GAMSSymbolRecord on position index.

Parameters
indexIndex position of key to be returned
Returns
Key a position index

◆ getKeys()

String [] com.gams.api.GAMSSymbolRecord.getKeys ( )

Retrieve keys of this GAMSSymbolRecord instance.

Exceptions
GAMSExceptionIf a record could not be retrieved, or the GAMSDatabase instance of this symbol has already been disposed therefore resources are no longer available.

◆ hashCode()

int com.gams.api.GAMSSymbolRecord.hashCode ( )

Returns a hash code value for the object.

Returns
a hash code value for this object.

◆ isDisposed()

boolean com.gams.api.GAMSSymbolRecord.isDisposed ( )

Inquire if this record has already been disposed.

Returns
true if disposed, false otherwise

◆ moveNext()

boolean com.gams.api.GAMSSymbolRecord.moveNext ( )

Iterate to next GAMSSymbolRecord of GAMSSymbol using the current criterion.

In case of a specific criterion has been specified, such as retrieving record in GAMSSymbol that meets a slice criteria (GAMSSymbol<T extends GAMSSymbolRecord>.getFirstRecord(String...)}) the method returns the next GAMSSymbolRecord that also meets the criteria. Otherwise the method returns the next sequential GAMSSymbolRecord.

Returns
true if successfully moved to the next record, false otherwise.
Since
24.1.3
Exceptions
GAMSExceptionif the GAMSDatabase instance has already been disposed.
See also
GAMSSymbol<T extends GAMSSymbolRecord>.getFirstRecord(String...)
GAMSSymbol<T extends GAMSSymbolRecord>.getLastRecord(String...)

◆ movePrevious()

boolean com.gams.api.GAMSSymbolRecord.movePrevious ( )

Iterate to previous GAMSSymbolRecord of GAMSSymbol using the current criterion.

In case of a specific criterion has been specified, such as retrieving record in GAMSSymbol that meets a slice criteria (GAMSSymbol<T extends GAMSSymbolRecord>.getLastRecord(String...)), the method returns the previous GAMSSymbolRecord that also meets the criteria. Otherwise the method returns the previous sequential GAMSSymbolRecord.

Returns
true if successfully moved to the previous record, false otherwise.
Since
24.1.3
Exceptions
GAMSExceptionif the GAMSDatabase instance has already been disposed.
See also
GAMSSymbol<T extends GAMSSymbolRecord>.getFirstRecord(String...)
GAMSSymbol<T extends GAMSSymbolRecord>.getLastRecord(String...)