Package nl.cwi.monetdb.embedded.tables
Class RowIterator
java.lang.Object
nl.cwi.monetdb.embedded.mapping.AbstractRowSet
nl.cwi.monetdb.embedded.tables.RowIterator
public final class RowIterator extends AbstractRowSet
The iterator class for a MonetDB table. It's possible to inspect the current currentColumns in the row as well
their mappings.
- Author:
- Pedro Ferreira
-
Field Summary
-
Method Summary
Modifier and Type Method Description <T> T
getColumnByIndex(int index)
Gets a column value as a Java class using the default mapping.<T> T
getColumnByIndex(int index, Class<T> javaClass)
Gets a column value as a Java class.<T> T
getColumnByName(String columnName)
Gets a column value as a Java class using the default mapping.<T> T
getColumnByName(String columnName, Class<T> javaClass)
Gets a column value as a Java class.int
getColumnIndexByName(String columnName)
Gets a column index in the result set by name.int
getCurrentIterationNumber()
Gets the current iteration number.MonetDBRow
getCurrentRow()
Gets the current row currentColumns values as Java objects.int
getCurrentTableRowNumber()
Gets the current row number of the table in the iteration.int
getFirstIndex()
Gets the first index used on this iteration.int
getLastIndex()
Gets the last index used on this iteration.MonetDBTable
getTable()
Gets the original table of this iterator.boolean
hasMore()
Checks if there are more rows to iterate after the current one.Methods inherited from class nl.cwi.monetdb.embedded.mapping.AbstractRowSet
getNumberOfColumns, getQueryResultTable
-
Method Details
-
getColumnIndexByName
Description copied from class:AbstractRowSet
Gets a column index in the result set by name.- Specified by:
getColumnIndexByName
in classAbstractRowSet
- Parameters:
columnName
- The column name- Returns:
- The index number
- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getTable
Gets the original table of this iterator.- Returns:
- The original table of this iterator
-
getFirstIndex
public int getFirstIndex()Gets the first index used on this iteration.- Returns:
- The first index used on this iteration
-
getLastIndex
public int getLastIndex()Gets the last index used on this iteration.- Returns:
- The last index used on this iteration
-
getCurrentIterationNumber
public int getCurrentIterationNumber()Gets the current iteration number.- Returns:
- The current iteration number
-
getCurrentTableRowNumber
public int getCurrentTableRowNumber()Gets the current row number of the table in the iteration.- Returns:
- The current row number of the table in the iteration
-
getCurrentRow
Gets the current row currentColumns values as Java objects.- Returns:
- The current row currentColumns values as Java objects
-
hasMore
public boolean hasMore()Checks if there are more rows to iterate after the current one.- Returns:
- There are more rows to iterate
-
getColumnByIndex
Gets a column value as a Java class.- Type Parameters:
T
- A Java class mapped to a MonetDB data type- Parameters:
index
- The index of the columnjavaClass
- The Java class- Returns:
- The column value as a Java class
-
getColumnByIndex
public <T> T getColumnByIndex(int index)Gets a column value as a Java class using the default mapping.- Type Parameters:
T
- A Java class mapped to a MonetDB data type- Parameters:
index
- The index of the column- Returns:
- The column value as a Java class
-
getColumnByName
public <T> T getColumnByName(String columnName, Class<T> javaClass) throws MonetDBEmbeddedExceptionGets a column value as a Java class.- Type Parameters:
T
- A Java class mapped to a MonetDB data type- Parameters:
columnName
- The name of the columnjavaClass
- The Java class- Returns:
- The column value as a Java class
- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getColumnByName
Gets a column value as a Java class using the default mapping.- Type Parameters:
T
- A Java class mapped to a MonetDB data type- Parameters:
columnName
- The name of the column- Returns:
- The column value as a Java class
- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-