[cvs] / jsr166 / src / main / java / util / Vector.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/Vector.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16, Sun Jun 25 20:05:33 2006 UTC revision 1.17, Mon Jun 26 00:17:48 2006 UTC
# Line 466  Line 466 
466       * <p>The index must be a value greater than or equal to {@code 0}       * <p>The index must be a value greater than or equal to {@code 0}
467       * and less than the current size of the vector.       * and less than the current size of the vector.
468       *       *
469       * <p>This method is identical in functionality to the set method       * <p>This method is identical in functionality to the
470       * (which is part of the List interface). Note that the set method reverses       * {@link #set(int, Object) set(int, E)}
471       * the order of the parameters, to more closely match array usage.  Note       * method (which is part of the {@link List} interface). Note that the
472       * also that the set method returns the old value that was stored at the       * {@code set} method reverses the order of the parameters, to more closely
473       * specified position.       * match array usage.  Note also that the {@code set} method returns the
474         * old value that was stored at the specified position.
475       *       *
476       * @param      obj     what the component is to be set to       * @param      obj     what the component is to be set to
477       * @param      index   the specified index       * @param      index   the specified index
478       * @throws  ArrayIndexOutOfBoundsException  if the index was invalid       * @throws ArrayIndexOutOfBoundsException if the index is out of range
479       * @see        #size()       *         ({@code index < 0 || index >= size()})
      * @see        List  
      * @see        #set(int, java.lang.Object)  
480       */       */
481      public synchronized void setElementAt(E obj, int index) {      public synchronized void setElementAt(E obj, int index) {
482          if (index >= elementCount) {          if (index >= elementCount) {
# Line 497  Line 496 
496       * <p>The index must be a value greater than or equal to {@code 0}       * <p>The index must be a value greater than or equal to {@code 0}
497       * and less than the current size of the vector.       * and less than the current size of the vector.
498       *       *
499       * <p>This method is identical in functionality to the remove method       * <p>This method is identical in functionality to the {@link #remove(int)}
500       * (which is part of the List interface).  Note that the remove method       * method (which is part of the {@link List} interface).  Note that the
501       * returns the old value that was stored at the specified position.       * {@code remove} method returns the old value that was stored at the
502         * specified position.
503       *       *
504       * @param      index   the index of the object to remove       * @param      index   the index of the object to remove
505       * @exception  ArrayIndexOutOfBoundsException  if the index was invalid       * @throws ArrayIndexOutOfBoundsException if the index is out of range
506       * @see        #size()       *         ({@code index < 0 || index >= size()})
      * @see        #remove(int)  
      * @see        List  
507       */       */
508      public synchronized void removeElementAt(int index) {      public synchronized void removeElementAt(int index) {
509          modCount++;          modCount++;
# Line 536  Line 534 
534       * index is equal to the current size of the vector, the new element       * index is equal to the current size of the vector, the new element
535       * is appended to the Vector.)       * is appended to the Vector.)
536       *       *
537       * <p>This method is identical in functionality to the add(Object, int) method       * <p>This method is identical in functionality to the
538       * (which is part of the List interface). Note that the add method reverses       * {@link #add(int, Object) add(int, E)}
539       * the order of the parameters, to more closely match array usage.       * method (which is part of the {@link List} interface).  Note that the
540         * {@code add} method reverses the order of the parameters, to more closely
541         * match array usage.
542       *       *
543       * @param      obj     the component to insert       * @param      obj     the component to insert
544       * @param      index   where to insert the new component       * @param      index   where to insert the new component
545       * @exception  ArrayIndexOutOfBoundsException  if the index was invalid       * @throws ArrayIndexOutOfBoundsException if the index is out of range
546       * @see        #size()       *         ({@code index < 0 || index > size()})
      * @see        #add(int, Object)  
      * @see        List  
547       */       */
548      public synchronized void insertElementAt(E obj, int index) {      public synchronized void insertElementAt(E obj, int index) {
549          modCount++;          modCount++;
# Line 564  Line 562 
562       * increasing its size by one. The capacity of this vector is       * increasing its size by one. The capacity of this vector is
563       * increased if its size becomes greater than its capacity.       * increased if its size becomes greater than its capacity.
564       *       *
565       * <p>This method is identical in functionality to the add(Object) method       * <p>This method is identical in functionality to the
566       * (which is part of the List interface).       * {@link #remove(Object)} method (which is part of the
567         * {@link List} interface).
568       *       *
569       * @param   obj   the component to be added       * @param   obj   the component to be added
      * @see        #add(Object)  
      * @see        List  
570       */       */
571      public synchronized void addElement(E obj) {      public synchronized void addElement(E obj) {
572          modCount++;          modCount++;
# Line 604  Line 601 
601      }      }
602    
603      /**      /**
604       * Removes all components from this vector and sets its size to zero.<p>       * Removes all components from this vector and sets its size to zero.
      *  
      * This method is identical in functionality to the clear method  
      * (which is part of the List interface).  
605       *       *
606       * @see     #clear       * <p>This method is identical in functionality to the {@link #clear}
607       * @see     List       * method (which is part of the {@link List} interface).
608       */       */
609      public synchronized void removeAllElements() {      public synchronized void removeAllElements() {
610          modCount++;          modCount++;
# Line 668  Line 662 
662       *          be stored, if it is big enough; otherwise, a new array of the       *          be stored, if it is big enough; otherwise, a new array of the
663       *          same runtime type is allocated for this purpose.       *          same runtime type is allocated for this purpose.
664       * @return an array containing the elements of the Vector       * @return an array containing the elements of the Vector
665       * @throws ArrayStoreException the runtime type of a is not a supertype       * @throws ArrayStoreException if the runtime type of a is not a supertype
666       * of the runtime type of every element in this Vector       * of the runtime type of every element in this Vector
667       * @throws NullPointerException if the given array is null       * @throws NullPointerException if the given array is null
668       * @since 1.2       * @since 1.2
# Line 692  Line 686 
686       *       *
687       * @param index index of the element to return       * @param index index of the element to return
688       * @return object at the specified index       * @return object at the specified index
689       * @exception ArrayIndexOutOfBoundsException index is out of range (index       * @throws ArrayIndexOutOfBoundsException if the index is out of range
690       *            &lt; 0 || index &gt;= size())       *            ({@code index < 0 || index >= size()})
691       * @since 1.2       * @since 1.2
692       */       */
693      public synchronized E get(int index) {      public synchronized E get(int index) {
# Line 710  Line 704 
704       * @param index index of the element to replace       * @param index index of the element to replace
705       * @param element element to be stored at the specified position       * @param element element to be stored at the specified position
706       * @return the element previously at the specified position       * @return the element previously at the specified position
707       * @exception ArrayIndexOutOfBoundsException index out of range       * @throws ArrayIndexOutOfBoundsException if the index is out of range
708       *            (index &lt; 0 || index &gt;= size())       *         ({@code index < 0 || index >= size()})
709       * @since 1.2       * @since 1.2
710       */       */
711      public synchronized E set(int index, E element) {      public synchronized E set(int index, E element) {
# Line 759  Line 753 
753       *       *
754       * @param index index at which the specified element is to be inserted       * @param index index at which the specified element is to be inserted
755       * @param element element to be inserted       * @param element element to be inserted
756       * @exception ArrayIndexOutOfBoundsException index is out of range       * @throws ArrayIndexOutOfBoundsException if the index is out of range
757       *            (index &lt; 0 || index &gt; size())       *         ({@code index < 0 || index > size()})
758       * @since 1.2       * @since 1.2
759       */       */
760      public void add(int index, E element) {      public void add(int index, E element) {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8