Class InstanceTableModel

  • All Implemented Interfaces:
    adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.data.spreadsheet.SpreadSheetSupporter, adams.gui.core.CustomSearchTableModel, Serializable, TableModel

    public class InstanceTableModel
    extends adams.gui.core.AbstractBaseTableModel
    implements adams.gui.core.CustomSearchTableModel
    A generic table model for displaying weka.core.Instances objects.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Data

        protected weka.core.Instances m_Data
        the underlying data.
    • Constructor Detail

      • InstanceTableModel

        public InstanceTableModel​(weka.core.Instances data)
        Initializes the model.
        Parameters:
        data - the underlying data
    • Method Detail

      • getAttribute

        protected weka.core.Attribute getAttribute​(int column)
        Returns the attribute for the given column.
        Parameters:
        column - the column to get the underlying attribute for
        Returns:
        the attribute
      • getData

        public weka.core.Instances getData()
        Returns the underlying data.
        Returns:
        the data
      • getRowCount

        public int getRowCount()
        Returns the number of rows.
        Specified by:
        getRowCount in interface TableModel
        Returns:
        the number of rows
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the table.
        Specified by:
        getColumnCount in interface TableModel
        Returns:
        the number of columns
      • getValueAt

        public Object getValueAt​(int row,
                                 int column)
        Returns the value at the given position.
        Specified by:
        getValueAt in interface TableModel
        Parameters:
        row - the row in the table
        column - the column in the table
        Returns:
        the value
      • isSearchMatch

        public boolean isSearchMatch​(adams.gui.core.SearchParameters params,
                                     int row)
        Tests whether the search matches the specified row.
        Specified by:
        isSearchMatch in interface adams.gui.core.CustomSearchTableModel
        Parameters:
        params - the search parameters
        row - the row of the underlying, unsorted model
        Returns:
        true if the search matches this row