类 ArffSortedTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
weka.gui.SortedTableModel
weka.gui.arffviewer.ArffSortedTableModel
- 所有已实现的接口:
Serializable
,EventListener
,TableModelListener
,TableModel
,Undoable
A sorter for the ARFF-Viewer - necessary because of the custom CellRenderer.
- 版本:
- $Revision: 1.4 $
- 作者:
- FracPete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 weka.gui.SortedTableModel
SortedTableModel.SortContainer
-
构造器概要
构造器构造器说明ArffSortedTableModel
(String filename) initializes the sorter w/o a model, but loads the given file and creates from that a modelArffSortedTableModel
(TableModel model) initializes the sorter with the given modelinitializes the sorter w/o a model, but uses the given data to create a model from that -
方法概要
修饰符和类型方法说明void
adds a listener to the list that is notified each time a change to data model occursvoid
adds an undo point to the undo historyvoid
attributeAsClassAt
(int columnIndex) sets the attribute at the given col index as the new class attributeboolean
canUndo()
returns whether an undo is possible, i.e.void
removes the undo historyvoid
deleteAttributeAt
(int columnIndex) deletes the attribute at the given col indexvoid
deleteAttributes
(int[] columnIndices) deletes the attributes at the given indicesvoid
deleteInstanceAt
(int rowIndex) deletes the instance at the given indexvoid
deleteInstances
(int[] rowIndices) deletes the instances at the given positionsgetAttributeAt
(int columnIndex) returns the attribute at the given index, can be NULL if not an attribute columnint
getAttributeColumn
(String name) returns the column of the given attribute name, -1 if not foundreturns the datadouble
getInstancesValueAt
(int rowIndex, int columnIndex) returns the double value of the underlying Instances object at the given position, -1 if out of boundsgetModelValueAt
(int rowIndex, int columnIndex) returns the value at the given positionint
getType
(int columnIndex) returns the TYPE of the attribute at the given positionint
getType
(int rowIndex, int columnIndex) returns the TYPE of the attribute at the given positionboolean
isMissingAt
(int rowIndex, int columnIndex) checks whether the value at the given position is missingboolean
returns whether the notification of changes is enabledboolean
returns whether the model is read-onlyboolean
returns whether undo support is enabledvoid
notfies all listener of the change of the modelvoid
removes a listener from the list that is notified each time a change to the data model occursvoid
renameAttributeAt
(int columnIndex, String newName) renames the attribute at the given col indexvoid
setInstances
(Instances data) sets the datavoid
setNotificationEnabled
(boolean enabled) sets whether the notification of changes is enabledvoid
setReadOnly
(boolean value) sets whether the model is read-onlyvoid
setUndoEnabled
(boolean enabled) sets whether undo support is enabledvoid
sortInstances
(int columnIndex) sorts the instances via the given attributevoid
undo()
undoes the last action从类继承的方法 weka.gui.SortedTableModel
addMouseListenerToHeader, getActualRow, getColumnClass, getColumnCount, getColumnName, getModel, getRowCount, getValueAt, isCellEditable, isSorted, setModel, setValueAt, sort, sort, tableChanged
-
构造器详细资料
-
ArffSortedTableModel
initializes the sorter w/o a model, but loads the given file and creates from that a model- 参数:
filename
- the file to load
-
ArffSortedTableModel
initializes the sorter w/o a model, but uses the given data to create a model from that- 参数:
data
- the data to use
-
ArffSortedTableModel
initializes the sorter with the given model- 参数:
model
- the model to use
-
-
方法详细资料
-
isNotificationEnabled
public boolean isNotificationEnabled()returns whether the notification of changes is enabled- 返回:
- true if notification of changes is enabled
-
setNotificationEnabled
public void setNotificationEnabled(boolean enabled) sets whether the notification of changes is enabled- 参数:
enabled
- enables/disables the notification
-
isUndoEnabled
public boolean isUndoEnabled()returns whether undo support is enabled- 指定者:
isUndoEnabled
在接口中Undoable
- 返回:
- true if undo support is enabled
-
setUndoEnabled
public void setUndoEnabled(boolean enabled) sets whether undo support is enabled- 指定者:
setUndoEnabled
在接口中Undoable
- 参数:
enabled
- whether to enable/disable undo support
-
isReadOnly
public boolean isReadOnly()returns whether the model is read-only- 返回:
- true if model is read-only
-
setReadOnly
public void setReadOnly(boolean value) sets whether the model is read-only- 参数:
value
- if true the model is set to read-only
-
getInstancesValueAt
public double getInstancesValueAt(int rowIndex, int columnIndex) returns the double value of the underlying Instances object at the given position, -1 if out of bounds- 参数:
rowIndex
- the row indexcolumnIndex
- the column index- 返回:
- the underlying value in the Instances object
-
getModelValueAt
returns the value at the given position- 参数:
rowIndex
- the row indexcolumnIndex
- the column index- 返回:
- the value of the model at the given position
-
getType
public int getType(int columnIndex) returns the TYPE of the attribute at the given position- 参数:
columnIndex
- the index of the column- 返回:
- the attribute type
-
getType
public int getType(int rowIndex, int columnIndex) returns the TYPE of the attribute at the given position- 参数:
rowIndex
- the index of the rowcolumnIndex
- the index of the column- 返回:
- the attribute type
-
deleteAttributeAt
public void deleteAttributeAt(int columnIndex) deletes the attribute at the given col index- 参数:
columnIndex
- the index of the attribute to delete
-
deleteAttributes
public void deleteAttributes(int[] columnIndices) deletes the attributes at the given indices- 参数:
columnIndices
- the column indices
-
renameAttributeAt
renames the attribute at the given col index- 参数:
columnIndex
- the index of the columnnewName
- the new name of the attribute
-
attributeAsClassAt
public void attributeAsClassAt(int columnIndex) sets the attribute at the given col index as the new class attribute- 参数:
columnIndex
- the index of the column
-
deleteInstanceAt
public void deleteInstanceAt(int rowIndex) deletes the instance at the given index- 参数:
rowIndex
- the index of the row
-
deleteInstances
public void deleteInstances(int[] rowIndices) deletes the instances at the given positions- 参数:
rowIndices
- the indices to delete
-
sortInstances
public void sortInstances(int columnIndex) sorts the instances via the given attribute- 参数:
columnIndex
- the index of the column
-
getAttributeColumn
returns the column of the given attribute name, -1 if not found- 参数:
name
- the name of the attribute- 返回:
- the column index or -1 if not found
-
isMissingAt
public boolean isMissingAt(int rowIndex, int columnIndex) checks whether the value at the given position is missing- 参数:
rowIndex
- the row indexcolumnIndex
- the column index- 返回:
- true if the value at the position is missing
-
setInstances
sets the data- 参数:
data
- the data to use
-
getInstances
returns the data- 返回:
- the current data
-
getAttributeAt
returns the attribute at the given index, can be NULL if not an attribute column- 参数:
columnIndex
- the index of the column- 返回:
- the attribute at the position
-
addTableModelListener
adds a listener to the list that is notified each time a change to data model occurs- 指定者:
addTableModelListener
在接口中TableModel
- 覆盖:
addTableModelListener
在类中AbstractTableModel
- 参数:
l
- the listener to add
-
removeTableModelListener
removes a listener from the list that is notified each time a change to the data model occurs- 指定者:
removeTableModelListener
在接口中TableModel
- 覆盖:
removeTableModelListener
在类中AbstractTableModel
- 参数:
l
- the listener to remove
-
notifyListener
notfies all listener of the change of the model- 参数:
e
- the event to send to the listeners
-
clearUndo
public void clearUndo()removes the undo history -
canUndo
public boolean canUndo()returns whether an undo is possible, i.e. whether there are any undo points saved so far -
undo
public void undo()undoes the last action -
addUndoPoint
public void addUndoPoint()adds an undo point to the undo history- 指定者:
addUndoPoint
在接口中Undoable
-