Methods Summary |
---|
public void | add(int index, java.lang.Object element)Inserts the specified element at the specified position in this list.
Throws an ArrayIndexOutOfBoundsException if the
index is out of range
(index < 0 || index > size() ).
delegate.insertElementAt(element, index);
fireIntervalAdded(this, index, index);
|
public void | addElement(java.lang.Object obj)Adds the specified component to the end of this list.
int index = delegate.size();
delegate.addElement(obj);
fireIntervalAdded(this, index, index);
|
public int | capacity()Returns the current capacity of this list.
return delegate.capacity();
|
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).
int index1 = delegate.size()-1;
delegate.removeAllElements();
if (index1 >= 0) {
fireIntervalRemoved(this, 0, index1);
}
|
public boolean | contains(java.lang.Object elem)Tests whether the specified object is a component in this list.
return delegate.contains(elem);
|
public void | copyInto(java.lang.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 IndexOutOfBoundsException is thrown.
delegate.copyInto(anArray);
|
public java.lang.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.
Note: Although this method is not deprecated, the preferred
method to use is get(int) , which implements the
List interface defined in the 1.2 Collections framework.
return delegate.elementAt(index);
|
public java.util.Enumeration | elements()Returns an enumeration of the components of this list.
return delegate.elements();
|
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.
delegate.ensureCapacity(minCapacity);
|
public java.lang.Object | firstElement()Returns the first component of this list.
Throws a NoSuchElementException if this
vector has no components.
return delegate.firstElement();
|
public java.lang.Object | get(int index)Returns the element at the specified position in this list.
Throws an ArrayIndexOutOfBoundsException
if the index is out of range
(index < 0 || index >= size() ).
return delegate.elementAt(index);
|
public java.lang.Object | getElementAt(int index)Returns the component at the specified index.
Note: Although this method is not deprecated, the preferred
method to use is get(int) , which implements the
List interface defined in the 1.2 Collections framework.
return delegate.elementAt(index);
|
public int | getSize()Returns the number of components in this list.
This method is identical to size , which implements the
List interface defined in the 1.2 Collections framework.
This method exists in conjunction with setSize so that
size is identifiable as a JavaBean property.
return delegate.size();
|
public int | indexOf(java.lang.Object elem)Searches for the first occurrence of elem .
return delegate.indexOf(elem);
|
public int | indexOf(java.lang.Object elem, int index)Searches for the first occurrence of elem , beginning
the search at index .
return delegate.indexOf(elem, index);
|
public void | insertElementAt(java.lang.Object obj, int index)Inserts the specified object as a component in this list at the
specified index .
Throws an ArrayIndexOutOfBoundsException if the index
is invalid.
Note: Although this method is not deprecated, the preferred
method to use is add(int,Object) , which implements the
List interface defined in the 1.2 Collections framework.
delegate.insertElementAt(obj, index);
fireIntervalAdded(this, index, index);
|
public boolean | isEmpty()Tests whether this list has any components.
return delegate.isEmpty();
|
public java.lang.Object | lastElement()Returns the last component of the list.
Throws a NoSuchElementException if this vector
has no components.
return delegate.lastElement();
|
public int | lastIndexOf(java.lang.Object elem)Returns the index of the last occurrence of elem .
return delegate.lastIndexOf(elem);
|
public int | lastIndexOf(java.lang.Object elem, int index)Searches backwards for elem , starting from the
specified index, and returns an index to it.
return delegate.lastIndexOf(elem, index);
|
public java.lang.Object | remove(int index)Removes the element at the specified position in this list.
Returns the element that was removed from the list.
Throws an ArrayIndexOutOfBoundsException
if the index is out of range
(index < 0 || index >= size() ).
Object rv = delegate.elementAt(index);
delegate.removeElementAt(index);
fireIntervalRemoved(this, index, index);
return rv;
|
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 clear , which implements the
List interface defined in the 1.2 Collections framework.
int index1 = delegate.size()-1;
delegate.removeAllElements();
if (index1 >= 0) {
fireIntervalRemoved(this, 0, index1);
}
|
public boolean | removeElement(java.lang.Object obj)Removes the first (lowest-indexed) occurrence of the argument
from this list.
int index = indexOf(obj);
boolean rv = delegate.removeElement(obj);
if (index >= 0) {
fireIntervalRemoved(this, index, index);
}
return rv;
|
public void | removeElementAt(int index)Deletes the component at the specified index.
Throws an ArrayIndexOutOfBoundsException if the index
is invalid.
Note: Although this method is not deprecated, the preferred
method to use is remove(int) , which implements the
List interface defined in the 1.2 Collections framework.
delegate.removeElementAt(index);
fireIntervalRemoved(this, index, index);
|
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.
Throws an ArrayIndexOutOfBoundsException
if the index was invalid.
Throws an IllegalArgumentException if
fromIndex > toIndex .
if (fromIndex > toIndex) {
throw new IllegalArgumentException("fromIndex must be <= toIndex");
}
for(int i = toIndex; i >= fromIndex; i--) {
delegate.removeElementAt(i);
}
fireIntervalRemoved(this, fromIndex, toIndex);
|
public java.lang.Object | set(int index, java.lang.Object element)Replaces the element at the specified position in this list with the
specified element.
Throws an ArrayIndexOutOfBoundsException
if the index is out of range
(index < 0 || index >= size() ).
Object rv = delegate.elementAt(index);
delegate.setElementAt(element, index);
fireContentsChanged(this, index, index);
return rv;
|
public void | setElementAt(java.lang.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.
Throws an ArrayIndexOutOfBoundsException if the index
is invalid.
Note: Although this method is not deprecated, the preferred
method to use is set(int,Object) , which implements the
List interface defined in the 1.2 Collections framework.
delegate.setElementAt(obj, index);
fireContentsChanged(this, index, index);
|
public void | setSize(int newSize)Sets the size of this list.
int oldSize = delegate.size();
delegate.setSize(newSize);
if (oldSize > newSize) {
fireIntervalRemoved(this, newSize, oldSize-1);
}
else if (oldSize < newSize) {
fireIntervalAdded(this, oldSize, newSize-1);
}
|
public int | size()Returns the number of components in this list.
return delegate.size();
|
public java.lang.Object[] | toArray()Returns an array containing all of the elements in this list in the
correct order.
Object[] rv = new Object[delegate.size()];
delegate.copyInto(rv);
return rv;
|
public java.lang.String | toString()Returns a string that displays and identifies this
object's properties.
return delegate.toString();
|
public void | trimToSize()Trims the capacity of this list to be the list's current size.
delegate.trimToSize();
|