程序包 weka.gui
类 CheckBoxList.CheckBoxListModel
java.lang.Object
javax.swing.AbstractListModel<E>
javax.swing.DefaultListModel
weka.gui.CheckBoxList.CheckBoxListModel
- 所有已实现的接口:
Serializable
,ListModel
- 封闭类:
- CheckBoxList
A specialized model.
- 版本:
- $Revision: 7059 $
- 作者:
- fracpete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器构造器说明initializes the model with no data.CheckBoxListModel
(Object[] listData) Constructs a CheckBoxListModel from an array of objects and then applies setModel to it.CheckBoxListModel
(Vector listData) Constructs a CheckBoxListModel from a Vector and then applies setModel to it. -
方法概要
修饰符和类型方法说明void
Inserts the specified element at the specified position in this list.void
addElement
(Object obj) Adds the specified component to the end of this list.boolean
Tests whether the specified object is a component in this list.void
Copies the components of this list into the specified array.elementAt
(int index) Returns the component at the specified index.Returns the first component of this list.get
(int index) Returns the element at the specified position in this list.boolean
getChecked
(int index) returns the checked state of the element at the given indexgetElementAt
(int index) Returns the component at the specified index.int
Searches for the first occurrence of elem.int
Searches for the first occurrence of elem, beginning the search at index.void
insertElementAt
(Object obj, int index) Inserts the specified object as a component in this list at the specified index.Returns the last component of the list.int
lastIndexOf
(Object elem) Returns the index of the last occurrence of elem.int
lastIndexOf
(Object elem, int index) Searches backwards for elem, starting from the specified index, and returns an index to it.remove
(int index) Removes the element at the specified position in this list.boolean
removeElement
(Object obj) Removes the first (lowest-indexed) occurrence of the argument from this list.Replaces the element at the specified position in this list with the specified element.void
setChecked
(int index, boolean checked) sets the checked state of the element at the given indexvoid
setElementAt
(Object obj, int index) Sets the component at the specified index of this list to be the specified object.Object[]
toArray()
Returns an array containing all of the elements in this list in the correct order.从类继承的方法 javax.swing.DefaultListModel
addAll, addAll, capacity, clear, elements, ensureCapacity, getSize, isEmpty, removeAllElements, removeElementAt, removeRange, setSize, size, toString, trimToSize
从类继承的方法 javax.swing.AbstractListModel
addListDataListener, getListDataListeners, getListeners, removeListDataListener
-
构造器详细资料
-
CheckBoxListModel
public CheckBoxListModel()initializes the model with no data. -
CheckBoxListModel
Constructs a CheckBoxListModel from an array of objects and then applies setModel to it.- 参数:
listData
- the data to use
-
CheckBoxListModel
Constructs a CheckBoxListModel from a Vector and then applies setModel to it.
-
-
方法详细资料
-
add
Inserts the specified element at the specified position in this list.- 覆盖:
add
在类中DefaultListModel
- 参数:
index
- index at which the specified element is to be insertedelement
- element to be inserted
-
addElement
Adds the specified component to the end of this list.- 覆盖:
addElement
在类中DefaultListModel
- 参数:
obj
- the component to be added
-
contains
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
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
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
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
Returns the element at the specified position in this list.- 覆盖:
get
在类中DefaultListModel
- 参数:
index
- of element to return- 抛出:
ArrayIndexOutOfBoundsException
-
getElementAt
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
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
Searches for the first occurrence of elem, beginning the search at index.- 覆盖:
indexOf
在类中DefaultListModel
- 参数:
elem
- the desired componentindex
- 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
Inserts the specified object as a component in this list at the specified index.- 覆盖:
insertElementAt
在类中DefaultListModel
- 参数:
obj
- the component to insertindex
- where to insert the new component- 抛出:
ArrayIndexOutOfBoundsException
-
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
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
Searches backwards for elem, starting from the specified index, and returns an index to it.- 覆盖:
lastIndexOf
在类中DefaultListModel
- 参数:
elem
- the desired componentindex
- 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
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
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
Replaces the element at the specified position in this list with the specified element.- 覆盖:
set
在类中DefaultListModel
- 参数:
index
- index of element to replaceelement
- element to be stored at the specified position- 抛出:
ArrayIndexOutOfBoundsException
-
setElementAt
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 toindex
- the specified index- 抛出:
ArrayIndexOutOfBoundsException
-
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 forchecked
- the new checked state
-