程序包 weka.gui

类 SortedTableModel

所有已实现的接口:
Serializable, EventListener, TableModelListener, TableModel
直接已知子类:
ArffSortedTableModel

public class SortedTableModel extends AbstractTableModel implements TableModelListener
Represents a TableModel with sorting functionality.
版本:
$Revision: 7059 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • SortedTableModel

      public SortedTableModel()
      initializes with no model
    • SortedTableModel

      public SortedTableModel(TableModel model)
      initializes with the given model
      参数:
      model - the model to initialize the sorted model with
  • 方法详细资料

    • setModel

      public void setModel(TableModel value)
      sets the model to use
      参数:
      value - the model to use
    • getModel

      public TableModel getModel()
      returns the current model, can be null
      返回:
      the current model
    • isSorted

      public boolean isSorted()
      returns whether the table was sorted
      返回:
      true if the table was sorted
    • getActualRow

      public int getActualRow(int visibleRow)
      Returns the actual underlying row the given visible one represents. Useful for retrieving "non-visual" data that is also stored in a TableModel.
      参数:
      visibleRow - the displayed row to retrieve the original row for
      返回:
      the original row
    • getColumnClass

      public Class getColumnClass(int columnIndex)
      Returns the most specific superclass for all the cell values in the column.
      指定者:
      getColumnClass 在接口中 TableModel
      覆盖:
      getColumnClass 在类中 AbstractTableModel
      参数:
      columnIndex - the index of the column
      返回:
      the class of the specified column
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns in the model
      指定者:
      getColumnCount 在接口中 TableModel
      返回:
      the number of columns in the model
    • getColumnName

      public String getColumnName(int columnIndex)
      Returns the name of the column at columnIndex
      指定者:
      getColumnName 在接口中 TableModel
      覆盖:
      getColumnName 在类中 AbstractTableModel
      参数:
      columnIndex - the column to retrieve the name for
      返回:
      the name of the specified column
    • getRowCount

      public int getRowCount()
      Returns the number of rows in the model.
      指定者:
      getRowCount 在接口中 TableModel
      返回:
      the number of rows in the model
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      Returns the value for the cell at columnIndex and rowIndex.
      指定者:
      getValueAt 在接口中 TableModel
      参数:
      rowIndex - the row
      columnIndex - the column
      返回:
      the value of the sepcified cell
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Returns true if the cell at rowIndex and columnIndex is editable.
      指定者:
      isCellEditable 在接口中 TableModel
      覆盖:
      isCellEditable 在类中 AbstractTableModel
      参数:
      rowIndex - the row
      columnIndex - the column
      返回:
      true if the cell is editable
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Sets the value in the cell at columnIndex and rowIndex to aValue.
      指定者:
      setValueAt 在接口中 TableModel
      覆盖:
      setValueAt 在类中 AbstractTableModel
      参数:
      aValue - the new value of the cell
      rowIndex - the row
      columnIndex - the column
    • sort

      public void sort(int columnIndex)
      sorts the table over the given column (ascending)
      参数:
      columnIndex - the column to sort over
    • sort

      public void sort(int columnIndex, boolean ascending)
      sorts the table over the given column, either ascending or descending
      参数:
      columnIndex - the column to sort over
      ascending - ascending if true, otherwise descending
    • tableChanged

      public void tableChanged(TableModelEvent e)
      This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.
      指定者:
      tableChanged 在接口中 TableModelListener
      参数:
      e - the event
    • addMouseListenerToHeader

      public void addMouseListenerToHeader(JTable table)
      Adds a mouselistener to the header: left-click on the header sorts in ascending manner, using shift-left-click in descending manner.
      参数:
      table - the table to add the listener to