Class DefaultTableDataSource

java.lang.Object
ca.phon.query.report.datasource.DefaultTableDataSource
All Implemented Interfaces:
TableDataSource

public class DefaultTableDataSource extends Object implements TableDataSource
Basic implementation of a TableDataSource. Data is stored in a list of arrays.
  • Constructor Details

    • DefaultTableDataSource

      public DefaultTableDataSource()
    • DefaultTableDataSource

      public DefaultTableDataSource(DefaultTableDataSource from)
  • Method Details

    • getRowData

      public List<Object[]> getRowData()
    • getRow

      public Object[] getRow(int row)
    • deleteRow

      public void deleteRow(int row)
    • insertRow

      public void insertRow(int idx, Object[] row)
    • addRow

      public void addRow(Object[] row)
    • setColumnCount

      protected void setColumnCount(int columns)
    • getColumnCount

      public int getColumnCount()
      Description copied from interface: TableDataSource
      Number of columns (not including column header)
      Specified by:
      getColumnCount in interface TableDataSource
    • getRowCount

      public int getRowCount()
      Description copied from interface: TableDataSource
      Number of rows (not including column header)
      Specified by:
      getRowCount in interface TableDataSource
    • getColumnIndex

      public int getColumnIndex(String columnName)
      Specified by:
      getColumnIndex in interface TableDataSource
    • findRows

      public List<Object[]> findRows(int[] keyCols, String[] rowKey)
      Get all rows which match the given key values for the given key columns.
      Parameters:
      keycols -
      keyvals -
      Returns:
      list of rows which match
    • findRows

      public List<Object[]> findRows(int[] keyCols, String[] rowKey, boolean ignoreDiacritics, boolean caseSensitive)
    • getValueAt

      public Object getValueAt(int row, String columnName)
    • getValueAt

      public Object getValueAt(int row, int col)
      Description copied from interface: TableDataSource
      Return the value at the given row+col.
      Specified by:
      getValueAt in interface TableDataSource
      Returns:
      the value at the given pos
    • getValueAt

      public Object getValueAt(String rowKey, String colName)
      Return the value at cell for given rowKey, colName. This method assumes that each row begins with a unique key.
      Parameters:
      rowKey -
      colName -
      Returns:
      cellValue at given rowKey, colName intersection.
    • getValueAt

      public Object getValueAt(String keyCol, String rowKey, String colName)
    • getValueAt

      public Object getValueAt(int keyCol, String rowKey, String colName)
    • getValueAt

      public Object getValueAt(int[] keyCols, String[] rowKey, String colName)
    • getValueAt

      public Object getValueAt(int[] keyCols, String[] rowKey, String colName, boolean ignoreDiacritics, boolean caseSensitive)
    • setValueAt

      public void setValueAt(int[] keyCols, String[] rowKey, String colName, Object value)
    • setValueAt

      public void setValueAt(int[] keyCols, String[] rowKey, String colName, boolean ignoreDiacritics, boolean caseSensitive, Object value)
    • setValueAt

      public void setValueAt(int row, int col, Object newVal)
    • setValueAt

      public void setValueAt(int row, String colname, Object newVal)
    • getDefaultColumnTitle

      public String getDefaultColumnTitle(int col)
    • getColumnTitle

      public String getColumnTitle(int col)
      Description copied from interface: TableDataSource
      Get the name of the specified column
      Specified by:
      getColumnTitle in interface TableDataSource
      Returns:
      the column title
    • setColumnTitle

      public void setColumnTitle(int col, String title)
    • inferColumnType

      public Class<?> inferColumnType(int col)
      Return the type of the first non-null value encountered in the specified column.
      Parameters:
      col -
      Returns:
      class of the first real value in the columm
    • append

      public void append(DefaultTableDataSource otherTable)