adams.gui.visualization.instance
Class InstanceTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by adams.gui.core.AbstractBaseTableModel
          extended by adams.gui.visualization.instance.InstanceTableModel
All Implemented Interfaces:
CustomSearchTableModel, Serializable, TableModel

public class InstanceTableModel
extends AbstractBaseTableModel
implements CustomSearchTableModel

A generic table model for displaying weka.core.Instances objects.

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  weka.core.Instances m_Data
          the underlying data.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
InstanceTableModel(weka.core.Instances data)
          Initializes the model.
 
Method Summary
protected  weka.core.Attribute getAttribute(int column)
          Returns the attribute for the given column.
 Class getColumnClass(int column)
          Returns the class for the column.
 int getColumnCount()
          Returns the number of columns in the table.
 String getColumnName(int column)
          Returns the name of the column.
 weka.core.Instances getData()
          Returns the underlying data.
 int getRowCount()
          Returns the number of rows.
 Object getValueAt(int row, int column)
          Returns the value at the given position.
 boolean isSearchMatch(SearchParameters params, int row)
          Tests whether the search matches the specified row.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
 

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

getColumnName

public String getColumnName(int column)
Returns the name of the column.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
column - the column to retrieve the name for
Returns:
the name of the column

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

getColumnClass

public Class getColumnClass(int column)
Returns the class for the column.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Parameters:
column - the column to retrieve the class for
Returns:
the class

isSearchMatch

public boolean isSearchMatch(SearchParameters params,
                             int row)
Tests whether the search matches the specified row.

Specified by:
isSearchMatch in interface CustomSearchTableModel
Parameters:
params - the search parameters
row - the row of the underlying, unsorted model
Returns:
true if the search matches this row


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.