public class ResultsetRowsCursor extends AbstractResultsetRows implements ResultsetRows
| Modifier and Type | Field and Description |
|---|---|
protected NativeMessageBuilder |
commandBuilder |
private int |
currentPositionInEntireResult
Where we are positionaly in the entire result set, used mostly to
facilitate easy 'isBeforeFirst()' and 'isFirst()' methods.
|
private java.util.List<Row> |
fetchedRows
The cache of rows we have retrieved from the server.
|
private boolean |
firstFetchCompleted
Have we attempted to fetch any rows yet?
|
private boolean |
lastRowFetched
Have we been told from the server that we have seen the last row?
|
private NativeProtocol |
protocol
Communications channel to the server
|
BEFORE_START_OF_ROWS, currentPositionInFetchedRows, metadata, owner, rowFactory, wasEmptyRESULT_SET_SIZE_UNKNOWN| Constructor and Description |
|---|
ResultsetRowsCursor(NativeProtocol ioChannel,
ColumnDefinition columnDefinition)
Creates a new cursor-backed row provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(Row row)
Adds a row.
|
void |
afterLast()
Moves to after last.
|
void |
beforeFirst()
Moves to before first.
|
void |
beforeLast()
Moves to before last.
|
void |
close()
We're done.
|
private void |
fetchMoreRows() |
int |
getPosition()
Returns the current position.
|
boolean |
hasNext() |
boolean |
isAfterLast()
Returns true if we got the last element.
|
boolean |
isBeforeFirst()
Returns if iteration has not occured yet.
|
boolean |
isEmpty()
Has no records.
|
boolean |
isFirst()
Are we on the first row of the result set?
|
boolean |
isLast()
Are we on the last row of the result set?
|
void |
moveRowRelative(int rows)
Moves the current position relative 'rows' from the current position.
|
Row |
next() |
void |
setCurrentRow(int rowNumber)
Moves the current position in the result set to the given row number.
|
getMetadata, getOwner, setMetadata, setOwner, wasEmptyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetadata, getOwner, isDynamic, setMetadata, setOwner, wasEmptyprivate java.util.List<Row> fetchedRows
private int currentPositionInEntireResult
private boolean lastRowFetched
private NativeProtocol protocol
private boolean firstFetchCompleted
protected NativeMessageBuilder commandBuilder
public ResultsetRowsCursor(NativeProtocol ioChannel, ColumnDefinition columnDefinition)
ioChannel - connection to the server.columnDefinition - field-level metadata for the results that this cursor covers.public boolean isAfterLast()
ResultsetRowsisAfterLast in interface ResultsetRowspublic boolean isBeforeFirst()
ResultsetRowsisBeforeFirst in interface ResultsetRowspublic int getPosition()
RowListgetPosition in interface RowListpublic boolean isEmpty()
ResultsetRowsisEmpty in interface ResultsetRowspublic boolean isFirst()
ResultsetRowsisFirst in interface ResultsetRowspublic boolean isLast()
ResultsetRowsisLast in interface ResultsetRowspublic void close()
ResultsetRowsclose in interface ResultsetRowspublic boolean hasNext()
hasNext in interface java.util.Iterator<Row>private void fetchMoreRows()
public void addRow(Row row)
ResultsetRowsaddRow in interface ResultsetRowsrow - the row to addpublic void afterLast()
ResultsetRowsafterLast in interface ResultsetRowspublic void beforeFirst()
ResultsetRowsbeforeFirst in interface ResultsetRowspublic void beforeLast()
ResultsetRowsbeforeLast in interface ResultsetRowspublic void moveRowRelative(int rows)
ResultsetRowsmoveRowRelative in interface ResultsetRowsrows - the relative number of rows to movepublic void setCurrentRow(int rowNumber)
ResultsetRowssetCurrentRow in interface ResultsetRowsrowNumber - row to move to