2362N/A * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class loosely implements the <code>java.util.Vector</code> 0N/A * API, in that it implements the 1.1.x version of 0N/A * <code>java.util.Vector</code>, has no collection class support, 0N/A * and notifies the <code>ListDataListener</code>s when changes occur. 0N/A * Presently it delegates to a <code>Vector</code>, 0N/A * in a future release it will be a real Collection implementation. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 1983N/A * @param <E> the type of the elements of this model 0N/A * @author Hans Muller 0N/A * Returns the number of components in this list. 0N/A * This method is identical to <code>size</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 0N/A * This method exists in conjunction with <code>setSize</code> so that 0N/A * <code>size</code> is identifiable as a JavaBean property. 0N/A * @return the number of components in this list 0N/A * Returns the component at the specified index. 0N/A * <b>Note:</b> Although this method is not deprecated, the preferred 0N/A * method to use is <code>get(int)</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 0N/A * @param index an index into this list 0N/A * @return the component at the specified index 0N/A * @exception ArrayIndexOutOfBoundsException if the <code>index</code> 0N/A * is negative or greater than the current size of this 0N/A * Copies the components of this list into the specified array. 0N/A * The array must be big enough to hold all the objects in this list, 0N/A * else an <code>IndexOutOfBoundsException</code> is thrown. 0N/A * @param anArray the array into which the components get copied 0N/A * @see Vector#copyInto(Object[]) 0N/A * Trims the capacity of this list to be the list's current size. 0N/A * @see Vector#trimToSize() 0N/A * Increases the capacity of this list, if necessary, to ensure 0N/A * that it can hold at least the number of components specified by 0N/A * the minimum capacity argument. 0N/A * @param minCapacity the desired minimum capacity 0N/A * @see Vector#ensureCapacity(int) 0N/A * Sets the size of this list. 0N/A * @param newSize the new size of this list 0N/A * @see Vector#setSize(int) 0N/A * Returns the current capacity of this list. 0N/A * @return the current capacity 0N/A * @see Vector#capacity() 0N/A * Returns the number of components in this list. 0N/A * @return the number of components in this list 0N/A * @see Vector#size() 0N/A * Tests whether this list has any components. 0N/A * @return <code>true</code> if and only if this list has 0N/A * no components, that is, its size is zero; 0N/A * <code>false</code> otherwise 0N/A * @see Vector#isEmpty() 0N/A * Returns an enumeration of the components of this list. 0N/A * @return an enumeration of the components of this list 0N/A * @see Vector#elements() 0N/A * Tests whether the specified object is a component in this list. 0N/A * @param elem an object 0N/A * @return <code>true</code> if the specified object 0N/A * is the same as a component in this list 0N/A * @see Vector#contains(Object) 0N/A * Searches for the first occurrence of <code>elem</code>. 0N/A * @param elem an object 0N/A * @return the index of the first occurrence of the argument in this 0N/A * list; returns <code>-1</code> if the object is not found 0N/A * @see Vector#indexOf(Object) 0N/A * Searches for the first occurrence of <code>elem</code>, beginning 0N/A * the search at <code>index</code>. 0N/A * @param elem an desired component 0N/A * @param index the index from which to begin searching 0N/A * @return the index where the first occurrence of <code>elem</code> 0N/A * is found after <code>index</code>; returns <code>-1</code> 0N/A * if the <code>elem</code> is not found in the list 0N/A * @see Vector#indexOf(Object,int) 0N/A * Returns the index of the last occurrence of <code>elem</code>. 0N/A * @param elem the desired component 0N/A * @return the index of the last occurrence of <code>elem</code> 0N/A * in the list; returns <code>-1</code> if the object is not found 0N/A * @see Vector#lastIndexOf(Object) 0N/A * Searches backwards for <code>elem</code>, starting from the 0N/A * specified index, and returns an index to it. 0N/A * @param elem the desired component 0N/A * @param index the index to start searching from 0N/A * @return the index of the last occurrence of the <code>elem</code> 0N/A * in this list at position less than <code>index</code>; 0N/A * returns <code>-1</code> if the object is not found 0N/A * @see Vector#lastIndexOf(Object,int) 0N/A * Returns the component at the specified index. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> if the index 0N/A * is negative or not less than the size of the list. 0N/A * <b>Note:</b> Although this method is not deprecated, the preferred 0N/A * method to use is <code>get(int)</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 0N/A * @param index an index into this list 0N/A * @return the component at the specified index 0N/A * @see Vector#elementAt(int) 0N/A * Returns the first component of this list. 0N/A * Throws a <code>NoSuchElementException</code> if this 0N/A * vector has no components. 0N/A * @return the first component of this list 0N/A * @see Vector#firstElement() 0N/A * Returns the last component of the list. 0N/A * Throws a <code>NoSuchElementException</code> if this vector 0N/A * has no components. 0N/A * @return the last component of the list 0N/A * @see Vector#lastElement() 0N/A * Sets the component at the specified <code>index</code> of this 1983N/A * list to be the specified element. The previous component at that 0N/A * position is discarded. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> if the index 0N/A * <b>Note:</b> Although this method is not deprecated, the preferred 0N/A * method to use is <code>set(int,Object)</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 1983N/A * @param element what the component is to be set to 0N/A * @param index the specified index 0N/A * @see #set(int,Object) 0N/A * @see Vector#setElementAt(Object,int) 0N/A * Deletes the component at the specified index. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> if the index 0N/A * <b>Note:</b> Although this method is not deprecated, the preferred 0N/A * method to use is <code>remove(int)</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 0N/A * @param index the index of the object to remove 0N/A * @see Vector#removeElementAt(int) 1983N/A * Inserts the specified element as a component in this list at the 0N/A * specified <code>index</code>. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> if the index 0N/A * <b>Note:</b> Although this method is not deprecated, the preferred 0N/A * method to use is <code>add(int,Object)</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 1983N/A * @param element the component to insert 0N/A * @param index where to insert the new component 0N/A * @exception ArrayIndexOutOfBoundsException if the index was invalid 0N/A * @see #add(int,Object) 0N/A * @see Vector#insertElementAt(Object,int) 0N/A * Adds the specified component to the end of this list. 1983N/A * @param element the component to be added 0N/A * @see Vector#addElement(Object) 0N/A * Removes the first (lowest-indexed) occurrence of the argument 0N/A * @param obj the component to be removed 0N/A * @return <code>true</code> if the argument was a component of this 0N/A * list; <code>false</code> otherwise 0N/A * @see Vector#removeElement(Object) 0N/A * Removes all components from this list and sets its size to zero. 0N/A * <b>Note:</b> Although this method is not deprecated, the preferred 0N/A * method to use is <code>clear</code>, which implements the 0N/A * <code>List</code> interface defined in the 1.2 Collections framework. 0N/A * @see Vector#removeAllElements() 0N/A * Returns a string that displays and identifies this 0N/A * object's properties. 0N/A * @return a String representation of this object 0N/A /* The remaining methods are included for compatibility with the 0N/A * Java 2 platform Vector class. 0N/A * Returns an array containing all of the elements in this list in the 0N/A * @return an array containing the elements of the list 0N/A * @see Vector#toArray() 0N/A * Returns the element at the specified position in this list. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> 0N/A * if the index is out of range 0N/A * (<code>index < 0 || index >= size()</code>). 0N/A * @param index index of element to return 0N/A * Replaces the element at the specified position in this list with the 0N/A * specified element. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> 0N/A * if the index is out of range 0N/A * (<code>index < 0 || index >= size()</code>). 0N/A * @param index index of element to replace 0N/A * @param element element to be stored at the specified position 0N/A * @return the element previously at the specified position 0N/A * Inserts the specified element at the specified position in this list. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> if the 0N/A * index is out of range 0N/A * (<code>index < 0 || index > size()</code>). 0N/A * @param index index at which the specified element is to be inserted 0N/A * @param element element to be inserted 0N/A * Removes the element at the specified position in this list. 0N/A * Returns the element that was removed from the list. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> 0N/A * if the index is out of range 0N/A * (<code>index < 0 || index >= size()</code>). 0N/A * @param index the index of the element to removed 1983N/A * @return the element previously at the specified position 0N/A * Removes all of the elements from this list. The list will 0N/A * be empty after this call returns (unless it throws an exception). 0N/A * Deletes the components at the specified range of indexes. 0N/A * The removal is inclusive, so specifying a range of (1,5) 0N/A * removes the component at index 1 and the component at index 5, 0N/A * as well as all components in between. 0N/A * Throws an <code>ArrayIndexOutOfBoundsException</code> 0N/A * if the index was invalid. 0N/A * Throws an <code>IllegalArgumentException</code> if 0N/A * <code>fromIndex > toIndex</code>. 0N/A * @param fromIndex the index of the lower end of the range 0N/A * @param toIndex the index of the upper end of the range 0N/A public void addAll(Collection c) { 0N/A public void addAll(int index, Collection c) {