de.vc.report

## Class ReportTableModel

- java.lang.Object
- - de.vc.report.ReportTableModel

- Direct Known Subclasses:
    CSVTableModel, DBTableModel, ListTableModel, MapTableModel, SwingTableModel

      public abstract class ReportTableModel
      extends java.lang.Object

  Datas for filling tables are provided by the report-table-model, as known from JDBC, Swing and AWT. The following pseudo-code shows, how data is retrieved from this model:
  `reset(); // move internal "pointer" before first row
  while (hasMoreRows()){ // check if there is a next row
  selectNextRow(); // select next row
  getCell(columnNameA); // get content of a cell by name A
  getCell(columnNameB); // get content of a cell by name B
  }
  disposeData();
  `

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReportTableModel()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract java.lang.String[]` | `definedColumns()` Gets all table columns of this model.
    `void` | `disposeData()` This methods is finally called if this model is not longer used.
    `protected void` | `doDisposeData()`
    `protected abstract java.lang.Object` | `doGetValueOfCell(java.lang.String columnName)`
    `protected abstract void` | `doReset()`
    `protected abstract void` | `doSelectNextRow()`
    `protected org.apache.commons.logging.Log` | `getLogger()`
    `int` | `getRowIndex()`
    `java.lang.Object` | `getValueOfCell(java.lang.String columnName)` Gets the value of a cell of the current selected row.
    `abstract boolean` | `hasMoreRows()` Determinates if more rows are available.
    `void` | `reset()` Reset this model.
    `void` | `selectNextRow()` Select the next row.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReportTableModel

          public ReportTableModel()

  - ### Method Detail

    - #### definedColumns

          public abstract java.lang.String[] definedColumns()

      Gets all table columns of this model. Note that two different table models must not have equal column names!
      Returns:
        String[] Name of columns.

    - #### disposeData

          public final void disposeData()
                                 throws ReportException

      This methods is finally called if this model is not longer used. Here you can close you streams and so on...
      Throws:
        `ReportException`

    - #### reset

          public final void reset()
                           throws ReportException

      Reset this model. That means the row pointer should point before the first row.
      Throws:
        `ReportException`

    - #### selectNextRow

          public final void selectNextRow()
                                   throws ReportException

      Select the next row.
      Throws:
        `ReportException`

    - #### doDisposeData

          protected void doDisposeData()
                                throws ReportException

      Throws:
        `ReportException`

    - #### doGetValueOfCell

          protected abstract java.lang.Object doGetValueOfCell(java.lang.String columnName)
                                                        throws ReportException

      Throws:
        `ReportException`

    - #### doReset

          protected abstract void doReset()
                                   throws ReportException

      Throws:
        `ReportException`

    - #### doSelectNextRow

          protected abstract void doSelectNextRow()
                                           throws ReportException

      Throws:
        `ReportException`

    - #### getRowIndex

          public final int getRowIndex()

    - #### getValueOfCell

          public final java.lang.Object getValueOfCell(java.lang.String columnName)
                                                throws ReportException

      Gets the value of a cell of the current selected row.
      Parameters:
        `columnName` - Name of column.
      Returns:
        Value of cell or NULL if undefined.
      Throws:
        `ReportException`

    - #### getLogger

          protected org.apache.commons.logging.Log getLogger()

    - #### hasMoreRows

          public abstract boolean hasMoreRows()
                                       throws ReportException

      Determinates if more rows are available.
      Returns:
        true, if at least one row is available.
      Throws:
        `ReportException`

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.