Class DataTableReader

    • Constructor Summary

      Constructors 
      Constructor Description
      DataTableReader​(DataTable table)
      Creats a new DataTableReader instance, backed by a DataTable, a simple in-memory data store.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the reader and any associated resources, such as database connections or files.
      boolean getBoolean​(int columnIndex)
      Gets a boolean value for the specified column.
      int getColumnCount()
      Gets the number of columns (fields) in the data.
      int getColumnIndex​(String columnLabel)
      Gets the zero based column index for a column name.
      String getColumnName​(int columnIndex)
      Gets the name of the column at the specified index.
      Class<?> getColumnType​(int columnIndex)
      Get the data type for the specified column.
      double getDouble​(int columnIndex)
      Gets a double value for the specified column.
      float getFloat​(int columnIndex)
      Gets a float value for the specified column.
      int getInt​(int columnIndex)
      Gets an integer value for the specified column.
      long getLong​(int columnIndex)
      Gets a long value for the specified column.
      Object getObject​(int columnIndex)
      Gets an Object representation for the value at the specified column.
      String getString​(int columnIndex)
      Gets a string value for the specified column.
      boolean isNull​(int columnIndex)
      Determines whether the value is null (missing) for the specified column.
      boolean read()
      Moves to the next record, if any exist.
    • Constructor Detail

      • DataTableReader

        public DataTableReader​(DataTable table)
        Creats a new DataTableReader instance, backed by a DataTable, a simple in-memory data store.
        Parameters:
        table -
    • Method Detail

      • read

        public boolean read()
        Description copied from interface: DataReader
        Moves to the next record, if any exist. This must be called to move to the first record.
        Specified by:
        read in interface DataReader
        Returns:
        true if the reader successfully moved to a new record, or false if no more records are present.
      • isNull

        public boolean isNull​(int columnIndex)
        Description copied from interface: DataRecord
        Determines whether the value is null (missing) for the specified column.
        Specified by:
        isNull in interface DataRecord
        Returns:
        true if the value is null (missing), false otherwise.
      • close

        public void close()
        Description copied from interface: DataReader
        Close the reader and any associated resources, such as database connections or files.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface DataReader
      • getString

        public String getString​(int columnIndex)
        Description copied from interface: DataRecord
        Gets a string value for the specified column.
        Specified by:
        getString in interface DataRecord
        Returns:
        The string at the specified column index.
      • getBoolean

        public boolean getBoolean​(int columnIndex)
        Description copied from interface: DataRecord
        Gets a boolean value for the specified column.
        Specified by:
        getBoolean in interface DataRecord
        Parameters:
        columnIndex - The zero based column index.
        Returns:
        The boolean value at the specified index.
      • getInt

        public int getInt​(int columnIndex)
        Description copied from interface: DataRecord
        Gets an integer value for the specified column.
        Specified by:
        getInt in interface DataRecord
        Parameters:
        columnIndex - The zero based column index.
        Returns:
        The integer value at the specified index.
      • getLong

        public long getLong​(int columnIndex)
        Description copied from interface: DataRecord
        Gets a long value for the specified column.
        Specified by:
        getLong in interface DataRecord
        Parameters:
        columnIndex - The zero based column index.
        Returns:
        The long value at the specified index.
      • getFloat

        public float getFloat​(int columnIndex)
        Description copied from interface: DataRecord
        Gets a float value for the specified column.
        Specified by:
        getFloat in interface DataRecord
        Parameters:
        columnIndex - The zero based column index.
        Returns:
        The float value at the specified index.
      • getDouble

        public double getDouble​(int columnIndex)
        Description copied from interface: DataRecord
        Gets a double value for the specified column.
        Specified by:
        getDouble in interface DataRecord
        Parameters:
        columnIndex - The zero based column index.
        Returns:
        The double value at the specified index.
      • getObject

        public Object getObject​(int columnIndex)
        Description copied from interface: DataRecord
        Gets an Object representation for the value at the specified column.
        Specified by:
        getObject in interface DataRecord
        Returns:
        The value at the specified column, or null if the value is missing.
      • getColumnIndex

        public int getColumnIndex​(String columnLabel)
        Description copied from interface: DataRecord
        Gets the zero based column index for a column name.
        Specified by:
        getColumnIndex in interface DataRecord
        Parameters:
        columnLabel - The name of the column.
        Returns:
        A zero based index for the column.
      • getColumnName

        public String getColumnName​(int columnIndex)
        Description copied from interface: DataRecord
        Gets the name of the column at the specified index.
        Specified by:
        getColumnName in interface DataRecord
        Parameters:
        columnIndex - The zero based index of the column.
        Returns:
        The name of the column at the specified index.
      • getColumnType

        public Class<?> getColumnType​(int columnIndex)
        Description copied from interface: DataRecord
        Get the data type for the specified column. @param columnIndex the zero based index of the column @return
        Specified by:
        getColumnType in interface DataRecord
      • getColumnCount

        public int getColumnCount()
        Description copied from interface: DataRecord
        Gets the number of columns (fields) in the data.
        Specified by:
        getColumnCount in interface DataRecord
        Returns:
        The column (field) count.