GAResultSetReadStream

Object subclass: #'GAResultSetReadStream' 

Overview

I provide a stream-like API to access a result set. I ask the result set for its rows in a lazy way. If no more rows are available, the #next method will return nil and the #next: method will return just an array with the available rows.

Class Method Details

on:

on: aResultSet 
^self new 
on: aResultSet;
yourself

Instance Method Details

currentRow

Gets the current row of the stream

initialize

initialize
super initialize
position := 0

next

Advances the stream and retrieves the row at the current position. If no more rows are available, it returns nil.

next

next:

Advances the stream and tries to retrieve the following N rows of the result set. If not enough rows are available, the retrieved array will contain only the available elements.

next: anInteger 
^Array streamContents: :str | anInteger timesRepeat: self next ifNotNilDo: :next | str nextPut: next ] ] ]

on:

on: aResultSet 
resultSet := aResultSet