程序包 weka.gui

类 CheckBoxList.CheckBoxListModel

所有已实现的接口:
Serializable, ListModel
封闭类:
CheckBoxList

public class CheckBoxList.CheckBoxListModel extends DefaultListModel
A specialized model.
版本:
$Revision: 7059 $
作者:
fracpete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • CheckBoxListModel

      public CheckBoxListModel()
      initializes the model with no data.
    • CheckBoxListModel

      public CheckBoxListModel(Object[] listData)
      Constructs a CheckBoxListModel from an array of objects and then applies setModel to it.
      参数:
      listData - the data to use
    • CheckBoxListModel

      public CheckBoxListModel(Vector listData)
      Constructs a CheckBoxListModel from a Vector and then applies setModel to it.
  • 方法详细资料

    • add

      public void add(int index, Object element)
      Inserts the specified element at the specified position in this list.
      覆盖:
      add 在类中 DefaultListModel
      参数:
      index - index at which the specified element is to be inserted
      element - element to be inserted
    • addElement

      public void addElement(Object obj)
      Adds the specified component to the end of this list.
      覆盖:
      addElement 在类中 DefaultListModel
      参数:
      obj - the component to be added
    • contains

      public boolean contains(Object elem)
      Tests whether the specified object is a component in this list.
      覆盖:
      contains 在类中 DefaultListModel
      参数:
      elem - the element to check
      返回:
      true if the element is in the list
    • copyInto

      public void copyInto(Object[] anArray)
      Copies the components of this list into the specified array.
      覆盖:
      copyInto 在类中 DefaultListModel
      参数:
      anArray - the array into which the components get copied
      抛出:
      IndexOutOfBoundsException - if the array is not big enough
    • elementAt

      public Object elementAt(int index)
      Returns the component at the specified index. Throws an ArrayIndexOutOfBoundsException if the index is negative or not less than the size of the list.
      覆盖:
      elementAt 在类中 DefaultListModel
      参数:
      index - an index into this list
      返回:
      the component at the specified index
      抛出:
      ArrayIndexOutOfBoundsException
    • firstElement

      public Object firstElement()
      Returns the first component of this list. Throws a NoSuchElementException if this vector has no components.
      覆盖:
      firstElement 在类中 DefaultListModel
      返回:
      the first component of this list
      抛出:
      NoSuchElementException
    • get

      public Object get(int index)
      Returns the element at the specified position in this list.
      覆盖:
      get 在类中 DefaultListModel
      参数:
      index - of element to return
      抛出:
      ArrayIndexOutOfBoundsException
    • getElementAt

      public Object getElementAt(int index)
      Returns the component at the specified index.
      指定者:
      getElementAt 在接口中 ListModel
      覆盖:
      getElementAt 在类中 DefaultListModel
      参数:
      index - an index into this list
      返回:
      the component at the specified index
      抛出:
      ArrayIndexOutOfBoundsException
    • indexOf

      public int indexOf(Object elem)
      Searches for the first occurrence of elem.
      覆盖:
      indexOf 在类中 DefaultListModel
      参数:
      elem - an object
      返回:
      the index of the first occurrence of the argument in this list; returns -1 if the object is not found
    • indexOf

      public int indexOf(Object elem, int index)
      Searches for the first occurrence of elem, beginning the search at index.
      覆盖:
      indexOf 在类中 DefaultListModel
      参数:
      elem - the desired component
      index - the index from which to begin searching
      返回:
      the index where the first occurrence of elem is found after index; returns -1 if the elem is not found in the list
    • insertElementAt

      public void insertElementAt(Object obj, int index)
      Inserts the specified object as a component in this list at the specified index.
      覆盖:
      insertElementAt 在类中 DefaultListModel
      参数:
      obj - the component to insert
      index - where to insert the new component
      抛出:
      ArrayIndexOutOfBoundsException
    • lastElement

      public Object lastElement()
      Returns the last component of the list. Throws a NoSuchElementException if this vector has no components.
      覆盖:
      lastElement 在类中 DefaultListModel
      返回:
      the last component of the list
      抛出:
      NoSuchElementException
    • lastIndexOf

      public int lastIndexOf(Object elem)
      Returns the index of the last occurrence of elem.
      覆盖:
      lastIndexOf 在类中 DefaultListModel
      参数:
      elem - the desired component
      返回:
      the index of the last occurrence of elem in the list; returns -1 if the object is not found
    • lastIndexOf

      public int lastIndexOf(Object elem, int index)
      Searches backwards for elem, starting from the specified index, and returns an index to it.
      覆盖:
      lastIndexOf 在类中 DefaultListModel
      参数:
      elem - the desired component
      index - the index to start searching from
      返回:
      the index of the last occurrence of the elem in this list at position less than index; returns -1 if the object is not found
    • remove

      public Object remove(int index)
      Removes the element at the specified position in this list. Returns the element that was removed from the list.
      覆盖:
      remove 在类中 DefaultListModel
      参数:
      index - the index of the element to removed
      抛出:
      ArrayIndexOutOfBoundsException
    • removeElement

      public boolean removeElement(Object obj)
      Removes the first (lowest-indexed) occurrence of the argument from this list.
      覆盖:
      removeElement 在类中 DefaultListModel
      参数:
      obj - the component to be removed
      返回:
      true if the argument was a component of this list; false otherwise
    • set

      public Object set(int index, Object element)
      Replaces the element at the specified position in this list with the specified element.
      覆盖:
      set 在类中 DefaultListModel
      参数:
      index - index of element to replace
      element - element to be stored at the specified position
      抛出:
      ArrayIndexOutOfBoundsException
    • setElementAt

      public void setElementAt(Object obj, int index)
      Sets the component at the specified index of this list to be the specified object. The previous component at that position is discarded.
      覆盖:
      setElementAt 在类中 DefaultListModel
      参数:
      obj - what the component is to be set to
      index - the specified index
      抛出:
      ArrayIndexOutOfBoundsException
    • toArray

      public Object[] toArray()
      Returns an array containing all of the elements in this list in the correct order.
      覆盖:
      toArray 在类中 DefaultListModel
      返回:
      an array containing the elements of the list
    • getChecked

      public boolean getChecked(int index)
      returns the checked state of the element at the given index
      参数:
      index - the index of the element to return the checked state for
      返回:
      the checked state of the specifed element
    • setChecked

      public void setChecked(int index, boolean checked)
      sets the checked state of the element at the given index
      参数:
      index - the index of the element to set the checked state for
      checked - the new checked state