com.gams.api.GAMSDatabaseIterator Class Reference

An iterator of a GAMSDatabase over a collection of GAMSSymbol. More...

Inherits Iterator< GAMSSymbol<?> >.

Public Member Functions

boolean hasNext ()
 Checks if the iteration has more elements. More...
 
GAMSSymbol<?> next ()
 Returns the next element T in the iteration. More...
 
void remove ()
 The purpose of this method is the remove all records of the last GAMSSymbol element returned by the iterator. More...
 

Detailed Description

An iterator of a GAMSDatabase over a collection of GAMSSymbol.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress.

Since
24.1.3
See also
GAMSDatabase
GAMSDatabase.iterator()
GAMSSymbol<T extends GAMSSymbolRecord>

Member Function Documentation

◆ hasNext()

boolean com.gams.api.GAMSDatabaseIterator.hasNext ( )

Checks if the iteration has more elements.

Returns
true if the iterator has more elements, false otherwise.
Exceptions
GAMSExceptionIf the GAMSDatabase instance of this symbol has already been disposed.

◆ next()

GAMSSymbol<?> com.gams.api.GAMSDatabaseIterator.next ( )

Returns the next element T in the iteration.

Returns
the next element T in the iteration.
Exceptions
GAMSExceptionIf either the next element is not found or the GAMSDatabase instance of this symbol has already been disposed.

◆ remove()

void com.gams.api.GAMSDatabaseIterator.remove ( )

The purpose of this method is the remove all records of the last GAMSSymbol element returned by the iterator.

However, the last symbol element is not removed from the database. This method can be called only once per call to next(). The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.

Exceptions
GAMSExceptionif all records of the last element could not be removed or the GAMSDatabase instance of this symbol has already been disposed.