Package org.eclipse.birt.report.engine.api

# Interface IDataIterator

public interface IDataIterator
An iterator on a result set from a prepared and executed query. Multiple IResultIterator objects could be associated with the same IExtractionResults object, if extraction is done at report level

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Closes this result and provide a hint that the consumer is done with this result, whose resources can be safely released as appropriate.
`IExtractionResults`
`getQueryResults()`
Returns `IExtractionResults` from which this data iterator is obtained.
`org.eclipse.birt.data.engine.api.IResultIterator`
`getResultIterator()`
return the IResultIterator directly
`IResultMetaData`
`getResultMetaData()`
Returns the metadata of this result set's detail row.
`Object`
`getValue(int index)`
`Object`
`getValue(String columnName)`
Returns the value of a column.
`boolean`
`isEmpty()`
see whether this iterator is empty
`boolean`
`next()`
Moves down one element from its current position of the iterator.

## Method Details

### getQueryResults

IExtractionResults getQueryResults()
Returns `IExtractionResults` from which this data iterator is obtained.

### getResultMetaData

IResultMetaData getResultMetaData() throws org.eclipse.birt.core.exception.BirtException
Returns the metadata of this result set's detail row.

Returns:
  The result metadata of a detail row.
Throws:
  `org.eclipse.birt.core.exception.BirtException`

### next

boolean next() throws org.eclipse.birt.core.exception.BirtException
Moves down one element from its current position of the iterator.

Returns:
  true if next element exists and has not reached the limit on the maximum number of rows that can be accessed.
Throws:
  `org.eclipse.birt.core.exception.BirtException` - if error occurs

### getValue

Object getValue(String columnName) throws org.eclipse.birt.core.exception.BirtException
Returns the value of a column.

Parameters:
  `columnName` - the name of the column
Returns:
  The value of the given column. It could be null.
Throws:
  `org.eclipse.birt.core.exception.BirtException` - if error occurs

### getValue

Object getValue(int index) throws org.eclipse.birt.core.exception.BirtException

Parameters:
  `index` - column index. It is 1 based
Throws:
  `org.eclipse.birt.core.exception.BirtException` - if error occurs

### close

void close()
Closes this result and provide a hint that the consumer is done with this result, whose resources can be safely released as appropriate.

### isEmpty

boolean isEmpty() throws org.eclipse.birt.core.exception.BirtException
see whether this iterator is empty

Returns:
  true if this iterator is false; otherwise, return false
Throws:
  `org.eclipse.birt.core.exception.BirtException`

### getResultIterator

org.eclipse.birt.data.engine.api.IResultIterator getResultIterator()
return the IResultIterator directly

Returns:
  the IResultIterator