java.util.Vector
API, in that it implements the 1.1.x version of
java.util.Vector
, has no collection class support,
and notifies the ListDataListener
s when changes occur.
Presently it delegates to a Vector
,
in a future release it will be a real Collection implementation.Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans
package.
Please see java.
.
Modifier and Type | Field and Description |
---|---|
private Vector |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | add(int
index at which the specified element is to be inserted index, E element to be inserted element)Inserts the specified element at the specified position in this list. |
public void | addAll(Collection<? extends E>
the collection which contains the elements to add c)Adds all of the elements present in the collection to the list. |
public void | addAll(int
index at which to insert the first element from the
specified collection index, Collection<? extends E> the collection which contains the elements to add c)Adds all of the elements present in the collection, starting from the specified index. |
public void | |
public int | |
public void | |
public boolean | |
public void | |
public E | Returns: the component at the specified indexan index into this list index)Returns the component at the specified index. |
public Enumeration | Returns: an enumeration of the components of this listReturns an enumeration of the components of this list. |
public void | ensureCapacity(int
the desired minimum capacity minCapacity)Increases the capacity of this list, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument. |
public E | |
public E | Returns: the element at the specified position in this listindex of element to return index)Returns the element at the specified position in this list. |
public E | Returns: the component at the specified indexan index into this list index)Implements javax. |
public int | Returns: the number of components in this listImplements javax. |
public int | |
public int | |
public void | insertElementAt(E
the component to insert element, int where to insert the new component index)Inserts the specified element as a component in this list at the
specified |
public boolean | Returns: true if and only if this list has
no components, that is, its size is zero;
false otherwiseTests whether this list has any components. |
public E | |
public int | Returns: the index of the last occurrence ofelem
in the list; returns elem if the object is not foundthe desired component elem)Returns the index of the last occurrence of |
public int | Returns: the index of the last occurrence of theelem
in this list at position less than index ;
returns -1 if the object is not foundthe desired component elem, int the index to start searching from index)Searches backwards for |
public E | Returns: the element previously at the specified positionthe index of the element to removed index)Removes the element at the specified position in this list. |
public void | |
public boolean | Returns: true if the argument was a component of this
list; false otherwisethe component to be removed obj)Removes the first (lowest-indexed) occurrence of the argument from this list. |
public void | removeElementAt(int
the index of the object to remove index)Deletes the component at the specified index. |
public void | removeRange(int
the index of the lower end of the range fromIndex, int the index of the upper end of the range toIndex)Deletes the components at the specified range of indexes. |
public E | Returns: the element previously at the specified positionindex of element to replace index, E element to be stored at the specified position element)Replaces the element at the specified position in this list with the specified element. |
public void | setElementAt(E
what the component is to be set to element, int the specified index index)Sets the component at the specified |
public void | |
public int | |
public Object[] | Returns: an array containing the elements of the listReturns an array containing all of the elements in this list in the correct order. |
public String | Returns: a String representation of this objectOverrides java. |
public void |
delegate | back to summary |
---|---|
private Vector<E> delegate |
DefaultListModel | back to summary |
---|---|
public DefaultListModel() Constructs a |
add | back to summary |
---|---|
public void add(int index, E element) Inserts the specified element at the specified position in this list.
|
addAll | back to summary |
---|---|
public void addAll(Collection<? extends E> c) Adds all of the elements present in the collection to the list.
|
addAll | back to summary |
---|---|
public void addAll(int index, Collection<? extends E> c) Adds all of the elements present in the collection, starting from the specified index.
|
addElement | back to summary |
---|---|
public void addElement(E element) Adds the specified component to the end of this list.
|
capacity | back to summary |
---|---|
public int capacity() Returns the current capacity of this list.
|
clear | back to summary |
---|---|
public void clear() Removes all of the elements from this list. The list will be empty after this call returns (unless it throws an exception). |
contains | back to summary |
---|---|
public boolean contains(Object elem) Tests whether the specified object is a component in this list.
|
copyInto | back to summary |
---|---|
public void copyInto(Object[] anArray) Copies the components of this list into the specified array.
The array must be big enough to hold all the objects in this list,
else an
|
elementAt | back to summary |
---|---|
public E elementAt(int index) Returns the component at the specified index. Note Although this method is not deprecated, the preferred
method to use is
|
elements | back to summary |
---|---|
public Enumeration Returns an enumeration of the components of this list.
|
ensureCapacity | back to summary |
---|---|
public void ensureCapacity(int minCapacity) Increases the capacity of this list, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
|
firstElement | back to summary |
---|---|
public E firstElement() Returns the first component of this list.
|
get | back to summary |
---|---|
public E get(int index) Returns the element at the specified position in this list.
|
getElementAt | back to summary |
---|---|
public E getElementAt(int index) Implements javax. Returns the component at the specified index. Note Although this method is not deprecated, the preferred
method to use is
|
getSize | back to summary |
---|---|
public int getSize() Implements javax. Returns the number of components in this list.
This method is identical to
|
indexOf | back to summary |
---|---|
public int indexOf(Object elem) Searches for the first occurrence of
|
indexOf | back to summary |
---|---|
public int indexOf(Object elem, int index) Searches for the first occurrence of
|
insertElementAt | back to summary |
---|---|
public void insertElementAt(E element, int index) Inserts the specified element as a component in this list at the
specified Note Although this method is not deprecated, the preferred
method to use is
|
isEmpty | back to summary |
---|---|
public boolean isEmpty() Tests whether this list has any components.
|
lastElement | back to summary |
---|---|
public E lastElement() Returns the last component of the list.
|
lastIndexOf | back to summary |
---|---|
public int lastIndexOf(Object elem) Returns the index of the last occurrence of
|
lastIndexOf | back to summary |
---|---|
public int lastIndexOf(Object elem, int index) Searches backwards for
|
remove | back to summary |
---|---|
public E remove(int index) Removes the element at the specified position in this list. Returns the element that was removed from the list
|
removeAllElements | back to summary |
---|---|
public void removeAllElements() Removes all components from this list and sets its size to zero. Note Although this method is not deprecated, the preferred
method to use is
|
removeElement | back to summary |
---|---|
public boolean removeElement(Object obj) Removes the first (lowest-indexed) occurrence of the argument from this list.
|
removeElementAt | back to summary |
---|---|
public void removeElementAt(int index) Deletes the component at the specified index. Note Although this method is not deprecated, the preferred
method to use is
|
removeRange | back to summary |
---|---|
public void removeRange(int fromIndex, int toIndex) Deletes the components at the specified range of indexes. The removal is inclusive, so specifying a range of (1,5) removes the component at index 1 and the component at index 5, as well as all components in between.
|
set | back to summary |
---|---|
public E set(int index, E element) Replaces the element at the specified position in this list with the specified element.
|
setElementAt | back to summary |
---|---|
public void setElementAt(E element, int index) Sets the component at the specified Note Although this method is not deprecated, the preferred
method to use is
|
setSize | back to summary |
---|---|
public void setSize(int newSize) Sets the size of this list.
|
size | back to summary |
---|---|
public int size() Returns the number of components in this list.
|
toArray | back to summary |
---|---|
public Object[] toArray() Returns an array containing all of the elements in this list in the correct order.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Returns a string that displays and identifies this object's properties.
|
trimToSize | back to summary |
---|---|
public void trimToSize() Trims the capacity of this list to be the list's current size.
|