com.apama.memorystore
Event Iterator


Represents an iterator that can be used to step through each Row of a Table in turn, making changes or reading data from the row.
See Also:
com.apama.memorystore.Table.begin() - Gets an iterator, beginning from the start of the table.

Action summary
 voidappendKeys(sequence<string> seq, integer n)

Append to the specified sequence, keys for up to n consecutive rows of the Table, beginning where this Iterator is pointing.
 booleandone()

Checks whether this Iterator has now reached the end of the Table.
 stringgetKey()

Get the key for the row this Iterator is pointing at.
 sequence<string>getKeys(integer n)

Get the keys for up to n consecutive rows of the Table beginning where this Iterator is pointing.
 com.apama.memorystore.RowgetRow()

Get the Row this Iterator is pointing at.
 voidstep()

Step this Iterator to the next row in the table.
 
Action detail

appendKeys

void appendKeys(sequence<string> seq, integer n)
Append to the specified sequence, keys for up to n consecutive rows of the Table, beginning where this Iterator is pointing.

The iterator will be advanced. If it becomes done then fewer than n keys will be appended.
Parameters:
seq - The sequence which is to be updated with the keys from the following n table rows.
n - The number of keys to get and append to the sequence.

done

boolean done()
Checks whether this Iterator has now reached the end of the Table.

You should check done() is not true before you call other Iterator actions (except for appendKeys() and getKeys()).

getKey

string getKey()
Get the key for the row this Iterator is pointing at.

To avoid an error that will terminate the monitor instance, always use done() to check that the iterator has not reached the end of the table before calling this action.

getKeys

sequence<stringgetKeys(integer n)
Get the keys for up to n consecutive rows of the Table beginning where this Iterator is pointing.

The iterator will be advanced. If it becomes done, a sequence of fewer than n keys will be returned.

The first key in the returned sequence is the key of the row that the iterator is pointing at when the action is called. When this action is finished, the iterator is pointing at the row immediately beyond that of the last key that was returned.
Parameters:
n - The number of keys to get and append to the sequence.

getRow

com.apama.memorystore.Row getRow()
Get the Row this Iterator is pointing at.

It is possible that the row the iterator is pointing at is no longer present. This can happen if another monitor deleted the row or table, or cleared the table while the iterator was pointing at that row.

If the requested row is no longer there, you receive a Row event that represents a row in which all fields have default values and for which Row.inTable() is false. This is the same result as if you call Table.get() on a key that does not exist yet.

To avoid an error that will terminate the monitor instance, always use done() to check that the iterator has not reached the end of the table before calling this action.

step

void step()
Step this Iterator to the next row in the table.

If there are no more rows the Iterator becomes done.

To avoid an error that will terminate the monitor instance, always use done() to check that the iterator has not reached the end of the table before calling this action.