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

Public Member Functions | |
String[] | getKeys () |
Retrieve keys of this GAMSSymbolRecord instance. | |
String | getKey (int index) |
Retrieve key of GAMSSymbolRecord on position index. | |
boolean | equals (Object obj) |
Indicates whether some other object is "equal to" this one. | |
int | hashCode () |
Returns a hash code value for the object. | |
boolean | isDisposed () |
Inquire if this record has already been disposed. | |
void | dispose () |
Release external resources hold by non-java library. | |
boolean | moveNext () |
Iterate to next GAMSSymbolRecord of GAMSSymbol using the current criterion. | |
boolean | movePrevious () |
Iterate to previous GAMSSymbolRecord of GAMSSymbol using the current criterion. | |
Protected Member Functions | |
GAMSSymbolRecord (GAMSSymbol<?> symbol, long ptr) | |
Create a new GAMSSymbolRecord instance. | |
GAMSSymbolRecord (GAMSSymbolRecord record) | |
Create a new GAMSSymbolRecord instance. | |
void | finalize () throws Throwable |
Release resources used by non-java library. | |
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.
GAMSSymbolRecord
also manages external resources and need to be properly disposed before the Java garbage collector reclaims the instance. When GAMSSymbolRecord
instance is no longer needed, an explicit call of dispose()
allows to early release the external resources before the instance becomes unreachable and the Java garbage collector reclaims the instance. The early release of resources that are no longer needed is useful when resource management is a critical issue in the application. Not having a call, the external resource hold by GAMSSymbolRecord
instance shall eventually be released when GAMSSymbolRecord
becomes unreachable and be ready to be collected by Java Garbage Collector.
- 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]
|
protected |
Create a new GAMSSymbolRecord instance.
The constructor assumes that the GAMSDatabase instance is not disposed (resources are still available).
- Parameters
-
symbol GAMSSymbol to initialize this instance from ptr symbol pointer to initialize this instance from
- Exceptions
-
GAMSException If the GAMSDatabase instance of this symbol has already been disposed, therefore resources are no longer available.
◆ GAMSSymbolRecord() [2/2]
|
protected |
Create a new GAMSSymbolRecord instance.
The constructor assumes that the GAMSDatabase instance is not disposed (resources are still available).
- Parameters
-
record GAMSSymbolRecord to initialize this instance from
- Exceptions
-
GAMSException If 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.
Explicitly call this method when the object is no longer needed. An early release of resources that are no longer needed is useful when resource management is a critical issue in the application. Not having a call; however, the external resource hold by GAMSSymbolRecord
instance shall eventually be released when GAMSSymbolRecord
becomes unreachable and be ready to be collected by Java Garbage Collector.
- Note
- This method releases external resources on demand and should be called on the object only once. Calling this method more than once may have some side effect.
◆ 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
-
obj the reference object with which to compare
- Returns
- true if this object is the same as the obj argument; false otherwise.
◆ finalize()
|
protected |
Release resources used by non-java library.
- Deprecated
- Deprecated since 50.0, this finalize method is subject to removal in a future version. See
dispose()
as an alternative to early release resources used by GAMSSymbolRecord.
◆ getKey()
String com.gams.api.GAMSSymbolRecord.getKey | ( | int | index | ) |
Retrieve key of GAMSSymbolRecord on position index.
- Parameters
-
index Index 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
-
GAMSException If 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
-
GAMSException if 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
-
GAMSException if the GAMSDatabase instance has already been disposed.
- See also
- GAMSSymbol<T extends GAMSSymbolRecord>.getFirstRecord(String...)
- GAMSSymbol<T extends GAMSSymbolRecord>.getLastRecord(String...)