Package weka.gui.sql
Class ResultSetTableModel
java.lang.Object
weka.gui.sql.ResultSetTableModel
- All Implemented Interfaces:
- TableModel
The model for an SQL ResultSet.
- Version:
- $Revision: 10222 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- 
Constructor SummaryConstructorsConstructorDescriptioninitializes the model, retrieves all rows.ResultSetTableModel(ResultSet rs, int rows) initializes the model, retrieves only the given amount of rows (0 means all).
- 
Method SummaryModifier and TypeMethodDescriptionvoidadds a listener to the list that is notified each time a change to data model occurs.voidfinalize()frees up the memory.Class<?>getColumnClass(int columnIndex) returns the most specific superclass for all the cell values in the column (always String).intreturns the number of columns in the model.getColumnName(int columnIndex) returns the name of the column at columnIndex.intreturns the number of rows in the model.getValueAt(int rowIndex, int columnIndex) returns the value for the cell at columnindex and rowIndex.booleanisCellEditable(int rowIndex, int columnIndex) returns true if the cell at rowindex and columnindexis editable.booleanisNullAt(int rowIndex, int columnIndex) checks whether the value of the cell is NULL.booleanisNumericAt(int columnIndex) returns whether the column at the given index is numeric.voidremoves a listener from the list that is notified each time a change to the data model occurs.voidsetValueAt(Object aValue, int rowIndex, int columnIndex) sets the value in the cell at columnIndex and rowIndex to aValue.
- 
Constructor Details- 
ResultSetTableModelinitializes the model, retrieves all rows.- Parameters:
- rs- the ResultSet to get the data from
 
- 
ResultSetTableModelinitializes the model, retrieves only the given amount of rows (0 means all).- Parameters:
- rs- the ResultSet to get the data from
- rows- the maximum number of rows to retrieve, 0 retrieves all
 
 
- 
- 
Method Details- 
addTableModelListeneradds a listener to the list that is notified each time a change to data model occurs.- Specified by:
- addTableModelListenerin interface- TableModel
- Parameters:
- l- the listener to add
 
- 
getColumnClassreturns the most specific superclass for all the cell values in the column (always String).- Specified by:
- getColumnClassin interface- TableModel
- Parameters:
- columnIndex- the index of the column
- Returns:
- the class
 
- 
getColumnCountpublic int getColumnCount()returns the number of columns in the model.- Specified by:
- getColumnCountin interface- TableModel
- Returns:
- the number of columns
 
- 
getColumnNamereturns the name of the column at columnIndex.- Specified by:
- getColumnNamein interface- TableModel
- Parameters:
- columnIndex- the index of the column
- Returns:
- the name
 
- 
getRowCountpublic int getRowCount()returns the number of rows in the model.- Specified by:
- getRowCountin interface- TableModel
- Returns:
- the number of data rows
 
- 
getValueAtreturns the value for the cell at columnindex and rowIndex.- Specified by:
- getValueAtin interface- TableModel
- Parameters:
- rowIndex- the row of the cell
- columnIndex- the column of the cell
- Returns:
- the data value
 
- 
isNullAtpublic boolean isNullAt(int rowIndex, int columnIndex) checks whether the value of the cell is NULL.- Parameters:
- rowIndex- the row of the cell
- columnIndex- the column of the cell
- Returns:
- true if the cell value is NULL
 
- 
isNumericAtpublic boolean isNumericAt(int columnIndex) returns whether the column at the given index is numeric.- Parameters:
- columnIndex- the column to check
- Returns:
- whether the column is numeric
 
- 
isCellEditablepublic boolean isCellEditable(int rowIndex, int columnIndex) returns true if the cell at rowindex and columnindexis editable.- Specified by:
- isCellEditablein interface- TableModel
- Parameters:
- rowIndex- the row of the cell
- columnIndex- the column of the cell
- Returns:
- always false
 
- 
removeTableModelListenerremoves a listener from the list that is notified each time a change to the data model occurs.- Specified by:
- removeTableModelListenerin interface- TableModel
- Parameters:
- l- the listener to remove
 
- 
setValueAtsets the value in the cell at columnIndex and rowIndex to aValue. Ignored.- Specified by:
- setValueAtin interface- TableModel
- Parameters:
- aValue- the value to set - ignored
- rowIndex- the row of the cell
- columnIndex- the column of the cell
 
- 
finalizefrees up the memory.- Throws:
- Throwable- if something goes wrong
 
 
-