Package adams.gui.visualization.instance
Class InstanceTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- adams.gui.core.AbstractBaseTableModel
-
- adams.gui.visualization.instance.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 Summary
Fields Modifier and Type Field Description protected weka.core.Instances
m_Data
the underlying data.-
Fields inherited from class adams.gui.core.AbstractBaseTableModel
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description InstanceTableModel(weka.core.Instances data)
Initializes the model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(adams.gui.core.SearchParameters params, int row)
Tests whether the search matches the specified row.-
Methods inherited from class adams.gui.core.AbstractBaseTableModel
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, setLoggingLevel, toSpreadSheet, toString
-
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, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
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 interfaceTableModel
- Returns:
- the number of rows
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns
-
getColumnName
public String getColumnName(int column)
Returns the name of the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- 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 interfaceTableModel
- Parameters:
row
- the row in the tablecolumn
- the column in the table- Returns:
- the value
-
getColumnClass
public Class getColumnClass(int column)
Returns the class for the column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
column
- the column to retrieve the class for- Returns:
- the class
-
isSearchMatch
public boolean isSearchMatch(adams.gui.core.SearchParameters params, int row)
Tests whether the search matches the specified row.- Specified by:
isSearchMatch
in interfaceadams.gui.core.CustomSearchTableModel
- Parameters:
params
- the search parametersrow
- the row of the underlying, unsorted model- Returns:
- true if the search matches this row
-
-