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
  • Method Details

    • getColumnIndexByName

      public int getColumnIndexByName​(String columnName) throws MonetDBEmbeddedException
      Description copied from class: AbstractRowSet
      Gets a column index in the result set by name.
      Specified by:
      getColumnIndexByName in class AbstractRowSet
      Parameters:
      columnName - The column name
      Returns:
      The index number
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getTable

      public MonetDBTable 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

      public MonetDBRow 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

      public <T> T getColumnByIndex​(int index, Class<T> javaClass)
      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 column
      javaClass - 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 MonetDBEmbeddedException
      Gets 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 column
      javaClass - The Java class
      Returns:
      The column value as a Java class
      Throws:
      MonetDBEmbeddedException - If an error in the database occurred.
    • getColumnByName

      public <T> T getColumnByName​(String columnName) throws MonetDBEmbeddedException
      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.