类 ArffTableModel

java.lang.Object
weka.gui.arffviewer.ArffTableModel
所有已实现的接口:
TableModel, Undoable

public class ArffTableModel extends Object implements TableModel, Undoable
The model for the Arff-Viewer.
版本:
$Revision: 9014 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
  • 构造器概要

    构造器
    构造器
    说明
    initializes the object and loads the given file
    initializes the model with the given data
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    adds a listener to the list that is notified each time a change to data model occurs
    void
    adds an undo point to the undo history, if the undo support is enabled
    void
    attributeAsClassAt(int columnIndex)
    sets the attribute at the given col index as the new class attribute, i.e.
    boolean
    returns whether an undo is possible, i.e.
    void
    removes the undo history
    void
    deleteAttributeAt(int columnIndex)
    deletes the attribute at the given col index.
    void
    deleteAttributeAt(int columnIndex, boolean notify)
    deletes the attribute at the given col index
    void
    deleteAttributes(int[] columnIndices)
    deletes the attributes at the given indices
    void
    deleteInstanceAt(int rowIndex)
    deletes the instance at the given index
    void
    deleteInstanceAt(int rowIndex, boolean notify)
    deletes the instance at the given index
    void
    deleteInstances(int[] rowIndices)
    deletes the instances at the given positions
    getAttributeAt(int columnIndex)
    returns the attribute at the given index, can be NULL if not an attribute column
    int
    returns the column of the given attribute name, -1 if not found
    getColumnClass(int columnIndex)
    returns the most specific superclass for all the cell values in the column (always String)
    int
    returns the number of columns in the model
    getColumnName(int columnIndex)
    returns the name of the column at columnIndex
    returns the data
    double
    getInstancesValueAt(int rowIndex, int columnIndex)
    returns the double value of the underlying Instances object at the given position, -1 if out of bounds
    int
    returns the number of rows in the model
    int
    getType(int columnIndex)
    returns the TYPE of the attribute at the given position
    int
    getType(int rowIndex, int columnIndex)
    returns the TYPE of the attribute at the given position
    getValueAt(int rowIndex, int columnIndex)
    returns the value for the cell at columnindex and rowIndex
    boolean
    isCellEditable(int rowIndex, int columnIndex)
    returns true if the cell at rowindex and columnindexis editable
    boolean
    isMissingAt(int rowIndex, int columnIndex)
    checks whether the value at the given position is missing
    boolean
    returns whether the notification of changes is enabled
    boolean
    returns whether the model is read-only
    boolean
    returns whether undo support is enabled
    void
    notfies all listener of the change of the model
    void
    removes a listener from the list that is notified each time a change to the data model occurs
    void
    renameAttributeAt(int columnIndex, String newName)
    renames the attribute at the given col index
    void
    sets the data
    void
    setNotificationEnabled(boolean enabled)
    sets whether the notification of changes is enabled
    void
    setReadOnly(boolean value)
    sets whether the model is read-only
    void
    setUndoEnabled(boolean enabled)
    sets whether undo support is enabled
    void
    setValueAt(Object aValue, int rowIndex, int columnIndex)
    sets the value in the cell at columnIndex and rowIndex to aValue.
    void
    setValueAt(Object aValue, int rowIndex, int columnIndex, boolean notify)
    sets the value in the cell at columnIndex and rowIndex to aValue.
    void
    sortInstances(int columnIndex)
    sorts the instances via the given attribute
    void
    undoes the last action

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ArffTableModel

      public ArffTableModel(String filename)
      initializes the object and loads the given file
      参数:
      filename - the file to load
    • ArffTableModel

      public ArffTableModel(Instances data)
      initializes the model with the given data
      参数:
      data - the data 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
    • setInstances

      public void setInstances(Instances data)
      sets the data
      参数:
      data - the data to use
    • getInstances

      public Instances getInstances()
      returns the data
      返回:
      the current data
    • getAttributeAt

      public Attribute getAttributeAt(int columnIndex)
      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
    • 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 row
      columnIndex - the index of the column
      返回:
      the attribute type
    • deleteAttributeAt

      public void deleteAttributeAt(int columnIndex)
      deletes the attribute at the given col index. notifies the listeners.
      参数:
      columnIndex - the index of the attribute to delete
    • deleteAttributeAt

      public void deleteAttributeAt(int columnIndex, boolean notify)
      deletes the attribute at the given col index
      参数:
      columnIndex - the index of the attribute to delete
      notify - whether to notify the listeners
    • deleteAttributes

      public void deleteAttributes(int[] columnIndices)
      deletes the attributes at the given indices
      参数:
      columnIndices - the column indices
    • renameAttributeAt

      public void renameAttributeAt(int columnIndex, String newName)
      renames the attribute at the given col index
      参数:
      columnIndex - the index of the column
      newName - 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, i.e. it moves it to the end of the attributes
      参数:
      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
    • deleteInstanceAt

      public void deleteInstanceAt(int rowIndex, boolean notify)
      deletes the instance at the given index
      参数:
      rowIndex - the index of the row
      notify - whether to notify the listeners
    • 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

      public int getAttributeColumn(String name)
      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
    • getColumnClass

      public Class getColumnClass(int columnIndex)
      returns the most specific superclass for all the cell values in the column (always String)
      指定者:
      getColumnClass 在接口中 TableModel
      参数:
      columnIndex - the column index
      返回:
      the class of the column
    • getColumnCount

      public int getColumnCount()
      returns the number of columns in the model
      指定者:
      getColumnCount 在接口中 TableModel
      返回:
      the number of columns
    • getColumnName

      public String getColumnName(int columnIndex)
      returns the name of the column at columnIndex
      指定者:
      getColumnName 在接口中 TableModel
      参数:
      columnIndex - the index of the column
      返回:
      the name of the column
    • getRowCount

      public int getRowCount()
      returns the number of rows in the model
      指定者:
      getRowCount 在接口中 TableModel
      返回:
      the number of rows
    • isMissingAt

      public boolean isMissingAt(int rowIndex, int columnIndex)
      checks whether the value at the given position is missing
      参数:
      rowIndex - the row index
      columnIndex - the column index
      返回:
      true if the value at the position is missing
    • 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 index
      columnIndex - the column index
      返回:
      the underlying value in the Instances object
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      returns the value for the cell at columnindex and rowIndex
      指定者:
      getValueAt 在接口中 TableModel
      参数:
      rowIndex - the row index
      columnIndex - the column index
      返回:
      the value at the position
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      returns true if the cell at rowindex and columnindexis editable
      指定者:
      isCellEditable 在接口中 TableModel
      参数:
      rowIndex - the index of the row
      columnIndex - the index of the column
      返回:
      true if the cell is editable
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      sets the value in the cell at columnIndex and rowIndex to aValue. but only the value and the value can be changed
      指定者:
      setValueAt 在接口中 TableModel
      参数:
      aValue - the new value
      rowIndex - the row index
      columnIndex - the column index
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex, boolean notify)
      sets the value in the cell at columnIndex and rowIndex to aValue. but only the value and the value can be changed
      参数:
      aValue - the new value
      rowIndex - the row index
      columnIndex - the column index
      notify - whether to notify the listeners
    • addTableModelListener

      public void addTableModelListener(TableModelListener l)
      adds a listener to the list that is notified each time a change to data model occurs
      指定者:
      addTableModelListener 在接口中 TableModel
      参数:
      l - the listener to add
    • removeTableModelListener

      public void removeTableModelListener(TableModelListener l)
      removes a listener from the list that is notified each time a change to the data model occurs
      指定者:
      removeTableModelListener 在接口中 TableModel
      参数:
      l - the listener to remove
    • notifyListener

      public void notifyListener(TableModelEvent e)
      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
      指定者:
      clearUndo 在接口中 Undoable
    • canUndo

      public boolean canUndo()
      returns whether an undo is possible, i.e. whether there are any undo points saved so far
      指定者:
      canUndo 在接口中 Undoable
      返回:
      returns TRUE if there is an undo possible
    • undo

      public void undo()
      undoes the last action
      指定者:
      undo 在接口中 Undoable
    • addUndoPoint

      public void addUndoPoint()
      adds an undo point to the undo history, if the undo support is enabled
      指定者:
      addUndoPoint 在接口中 Undoable
      另请参阅: