Package com.mysql.cj.protocol.a.result
Class ResultsetRowsStreaming<T extends ProtocolEntity>
java.lang.Object
com.mysql.cj.protocol.a.result.AbstractResultsetRows
com.mysql.cj.protocol.a.result.ResultsetRowsStreaming<T>
- Type Parameters:
T- ProtocolEntity type
- All Implemented Interfaces:
ProtocolEntity,ResultsetRows,RowList,java.util.Iterator<Row>
public class ResultsetRowsStreaming<T extends ProtocolEntity> extends AbstractResultsetRows implements ResultsetRows
Provides streaming of Resultset rows. Each next row is consumed from the
input stream only on
next() call. Consumed rows are not cached thus
we only stream result sets when they are forward-only, read-only, and the
fetch size has been set to Integer.MIN_VALUE (rows are read one by one).-
Field Summary
Fields inherited from class com.mysql.cj.protocol.a.result.AbstractResultsetRows
BEFORE_START_OF_ROWS, currentPositionInFetchedRows, metadata, owner, rowFactory, wasEmpty -
Constructor Summary
Constructors Constructor Description ResultsetRowsStreaming(NativeProtocol io, ColumnDefinition columnDefinition, boolean isBinaryEncoded, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)Creates a new RowDataDynamic object. -
Method Summary
Modifier and Type Method Description voidafterLast()Moves to after last.voidbeforeFirst()Moves to before first.voidbeforeLast()Moves to before last.voidclose()We're done.booleanhasNext()booleanisAfterLast()Returns true if we got the last element.booleanisBeforeFirst()Returns if iteration has not occured yet.booleanisEmpty()Has no records.booleanisFirst()Are we on the first row of the result set?booleanisLast()Are we on the last row of the result set?voidmoveRowRelative(int rows)Moves the current position relative 'rows' from the current position.Rownext()voidsetCurrentRow(int rowNumber)Moves the current position in the result set to the given row number.Methods inherited from class com.mysql.cj.protocol.a.result.AbstractResultsetRows
getMetadata, getOwner, setMetadata, setOwner, wasEmptyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mysql.cj.protocol.ResultsetRows
addRow, getMetadata, getOwner, isDynamic, setMetadata, setOwner, wasEmpty
-
Constructor Details
-
ResultsetRowsStreaming
public ResultsetRowsStreaming(NativeProtocol io, ColumnDefinition columnDefinition, boolean isBinaryEncoded, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)Creates a new RowDataDynamic object.- Parameters:
io- the connection to MySQL that this data is coming fromcolumnDefinition- the metadata that describe this dataisBinaryEncoded- is this data in native format?resultSetFactory-ProtocolEntityFactory
-
-
Method Details
-
close
public void close()Description copied from interface:ResultsetRowsWe're done.- Specified by:
closein interfaceResultsetRows
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacejava.util.Iterator<T extends ProtocolEntity>
-
isAfterLast
public boolean isAfterLast()Description copied from interface:ResultsetRowsReturns true if we got the last element.- Specified by:
isAfterLastin interfaceResultsetRows- Returns:
- true if after last row
-
isBeforeFirst
public boolean isBeforeFirst()Description copied from interface:ResultsetRowsReturns if iteration has not occured yet.- Specified by:
isBeforeFirstin interfaceResultsetRows- Returns:
- true if before first row
-
isEmpty
public boolean isEmpty()Description copied from interface:ResultsetRowsHas no records.- Specified by:
isEmptyin interfaceResultsetRows- Returns:
- true if no records
-
isFirst
public boolean isFirst()Description copied from interface:ResultsetRowsAre we on the first row of the result set?- Specified by:
isFirstin interfaceResultsetRows- Returns:
- true if on first row
-
isLast
public boolean isLast()Description copied from interface:ResultsetRowsAre we on the last row of the result set?- Specified by:
isLastin interfaceResultsetRows- Returns:
- true if on last row
-
next
- Specified by:
nextin interfacejava.util.Iterator<T extends ProtocolEntity>
-
afterLast
public void afterLast()Description copied from interface:ResultsetRowsMoves to after last.- Specified by:
afterLastin interfaceResultsetRows
-
beforeFirst
public void beforeFirst()Description copied from interface:ResultsetRowsMoves to before first.- Specified by:
beforeFirstin interfaceResultsetRows
-
beforeLast
public void beforeLast()Description copied from interface:ResultsetRowsMoves to before last.- Specified by:
beforeLastin interfaceResultsetRows
-
moveRowRelative
public void moveRowRelative(int rows)Description copied from interface:ResultsetRowsMoves the current position relative 'rows' from the current position.- Specified by:
moveRowRelativein interfaceResultsetRows- Parameters:
rows- the relative number of rows to move
-
setCurrentRow
public void setCurrentRow(int rowNumber)Description copied from interface:ResultsetRowsMoves the current position in the result set to the given row number.- Specified by:
setCurrentRowin interfaceResultsetRows- Parameters:
rowNumber- row to move to
-