Top Description Fields Constructors Methods
com.mysql.cj.xdevapi

public abstract Class AbstractDataResult<T>

extends Object
implements ResultStreamer, Iterator<T>, Result
Class Inheritance
All Implemented Interfaces
com.mysql.cj.xdevapi.Result, com.mysql.cj.QueryResult, java.util.Iterator, com.mysql.cj.protocol.ResultStreamer
Known Direct Subclasses
com.mysql.cj.xdevapi.DocResultImpl, com.mysql.cj.xdevapi.RowResultImpl
Type Parameters
<T>
Result entry type
Imports
java.util.ArrayList, .Collections, .Iterator, .List, .NoSuchElementException, java.util.function.Supplier, com.mysql.cj.exceptions.WrongArgumentException, com.mysql.cj.protocol.ProtocolEntity, .ProtocolEntityFactory, .ResultStreamer, com.mysql.cj.protocol.x.StatementExecuteOk, .XMessage, com.mysql.cj.result.BufferedRowList, .Row, .RowList

Base class for data set results.

Field Summary

Modifier and TypeField and Description
protected List<T>
all

List of all elements.

protected Supplier<ProtocolEntity>
protected int
protected StatementExecuteOk
protected int
protected RowList
protected ProtocolEntityFactory<T, XMessage>

Constructor Summary

AccessConstructor and Description
public
AbstractDataResult(RowList
RowList object
rows
,
Supplier<ProtocolEntity>
Supplier for StatementExecuteOk object
completer
,
ProtocolEntityFactory<T, XMessage> rowToData)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

number of elements in result
count
()

Return the number of items in this result.

public List<T>

Returns:

list of result elements
fetchAll
()

Create a list of all elements in the result forcing internal buffering.

public void
public long
getAffectedItemsCount()

Implements com.mysql.cj.xdevapi.Result.getAffectedItemsCount.

Get the count of affected items from manipulation statements.

public StatementExecuteOk

Returns:

StatementExecuteOk object
getStatementExecuteOk
()

Get StatementExecuteOk object finalizing the result transfer.

public Iterator<Warning>
getWarnings()

Implements com.mysql.cj.xdevapi.Result.getWarnings.

Get warnings generated during statement execution.

public int
getWarningsCount()

Implements com.mysql.cj.xdevapi.Result.getWarningsCount.

Get the number of warnings generated during statement execution.

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public T
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allback to summary
protected List<T> all

List of all elements. null until requested via fetchAll().

completerback to summary
protected Supplier<ProtocolEntity> completer
countback to summary
protected int count
okback to summary
protected StatementExecuteOk ok
positionback to summary
protected int position
rowsback to summary
protected RowList rows
rowToDataback to summary
protected ProtocolEntityFactory<T, XMessage> rowToData

Constructor Detail

AbstractDataResultback to summary
public AbstractDataResult(RowList rows, Supplier<ProtocolEntity> completer, ProtocolEntityFactory<T, XMessage> rowToData)

Constructor.

Parameters
rows:RowList

RowList object

completer:Supplier<ProtocolEntity>

Supplier for StatementExecuteOk object

rowToData:ProtocolEntityFactory<T, XMessage>

ProtocolEntityFactory

Method Detail

countback to summary
public long count()

Return the number of items in this result. Forces internal buffering of the entire result.

Returns:long

number of elements in result

fetchAllback to summary
public List<T> fetchAll()

Create a list of all elements in the result forcing internal buffering.

Returns:List<T>

list of result elements

finishStreamingback to summary
public void finishStreaming()

Implements com.mysql.cj.protocol.ResultStreamer.finishStreaming.

Doc from com.mysql.cj.protocol.ResultStreamer.finishStreaming.

Finish the result streaming. This happens if a new command is started or the warnings/etc are requested. This is safe to call multiple times and only has an effect the first time.

Annotations
@Override
getAffectedItemsCountback to summary
public long getAffectedItemsCount()

Implements com.mysql.cj.xdevapi.Result.getAffectedItemsCount.

Doc from com.mysql.cj.xdevapi.Result.getAffectedItemsCount.

Get the count of affected items from manipulation statements. This method forces internal buffering of the result.

Returns:long

count

Annotations
@Override
getStatementExecuteOkback to summary
public StatementExecuteOk getStatementExecuteOk()

Get StatementExecuteOk object finalizing the result transfer. Forces internal buffering of the entire result.

Returns:StatementExecuteOk

StatementExecuteOk object

getWarningsback to summary
public Iterator<Warning> getWarnings()

Implements com.mysql.cj.xdevapi.Result.getWarnings.

Doc from com.mysql.cj.xdevapi.Result.getWarnings.

Get warnings generated during statement execution. This method forces internal buffering of the result.

Returns:Iterator<Warning>

iterator over warnings

Annotations
@Override
getWarningsCountback to summary
public int getWarningsCount()

Implements com.mysql.cj.xdevapi.Result.getWarningsCount.

Doc from com.mysql.cj.xdevapi.Result.getWarningsCount.

Get the number of warnings generated during statement execution. This method forces internal buffering of the result.

Returns:int

number of warnings

Annotations
@Override
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public T next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:T

the next element in the iteration

Annotations
@Override