Class TableModel

java.lang.Object
org.springframework.shell.table.TableModel
Direct Known Subclasses:
ArrayTableModel, BeanListTableModel

public abstract class TableModel extends Object
Abstracts away the contract a Table will use to retrieve tabular data.
  • Constructor Details

    • TableModel

      public TableModel()
  • Method Details

    • getRowCount

      public abstract int getRowCount()
      Returns:
      the number of rows that can be queried. Values between 0 and rowCount-1 inclusive are valid values.
    • getColumnCount

      public abstract int getColumnCount()
      Returns:
      the number of columns that can be queried. Values between 0 and columnCount-1 inclusive are valid values.
    • getValue

      public abstract Object getValue(int row, int column)
      Parameters:
      row - the row that is being queried
      column - the column that is being queried
      Returns:
      the data value to be displayed at a given row and column, which may be null.
    • transpose

      public TableModel transpose()
      Returns:
      a transposed view of this model, where rows become columns and vice-versa.