[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.15, Sun Jun 25 19:58:14 2006 UTC revision 1.16, Sun Jun 25 20:05:33 2006 UTC
# Line 234  Line 234 
234       * components at index {@code newSize} and greater are discarded.       * components at index {@code newSize} and greater are discarded.
235       *       *
236       * @param   newSize   the new size of this vector       * @param   newSize   the new size of this vector
237       * @throws  ArrayIndexOutOfBoundsException if new size is negative       * @throws ArrayIndexOutOfBoundsException if the new size is negative
238       */       */
239      public synchronized void setSize(int newSize) {      public synchronized void setSize(int newSize) {
240          modCount++;          modCount++;
# Line 461  Line 461 
461      /**      /**
462       * Sets the component at the specified {@code index} of this       * Sets the component at the specified {@code index} of this
463       * vector to be the specified object. The previous component at that       * vector to be the specified object. The previous component at that
464       * position is discarded.<p>       * position is discarded.
465       *       *
466       * 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. <p>       * and less than the current size of the vector.
468       *       *
469       * This method is identical in functionality to the set method       * <p>This method is identical in functionality to the set method
470       * (which is part of the List interface). Note that the set method reverses       * (which is part of the List interface). Note that the set method reverses
471       * the order of the parameters, to more closely match array usage.  Note       * the order of the parameters, to more closely match array usage.  Note
472       * also that the set method returns the old value that was stored at the       * also that the set method returns the old value that was stored at the
# Line 562  Line 562 
562      /**      /**
563       * Adds the specified component to the end of this vector,       * Adds the specified component to the end of this vector,
564       * increasing its size by one. The capacity of this vector is       * increasing its size by one. The capacity of this vector is
565       * increased if its size becomes greater than its capacity. <p>       * increased if its size becomes greater than its capacity.
566       *       *
567       * This method is identical in functionality to the add(Object) method       * <p>This method is identical in functionality to the add(Object) method
568       * (which is part of the List interface).       * (which is part of the List interface).
569       *       *
570       * @param   obj   the component to be added       * @param   obj   the component to be added
# Line 582  Line 582 
582       * from this vector. If the object is found in this vector, each       * from this vector. If the object is found in this vector, each
583       * component in the vector with an index greater or equal to the       * component in the vector with an index greater or equal to the
584       * object's index is shifted downward to have an index one smaller       * object's index is shifted downward to have an index one smaller
585       * than the value it had previously.<p>       * than the value it had previously.
586       *       *
587       * This method is identical in functionality to the remove(Object)       * <p>This method is identical in functionality to the remove(Object)
588       * method (which is part of the List interface).       * method (which is part of the List interface).
589       *       *
590       * @param   obj   the component to be removed       * @param   obj   the component to be removed
# Line 655  Line 655 
655       * correct order; the runtime type of the returned array is that of the       * correct order; the runtime type of the returned array is that of the
656       * specified array.  If the Vector fits in the specified array, it is       * specified array.  If the Vector fits in the specified array, it is
657       * returned therein.  Otherwise, a new array is allocated with the runtime       * returned therein.  Otherwise, a new array is allocated with the runtime
658       * type of the specified array and the size of this Vector.<p>       * type of the specified array and the size of this Vector.
659       *       *
660       * If the Vector fits in the specified array with room to spare       * <p>If the Vector fits in the specified array with room to spare
661       * (i.e., the array has more elements than the Vector),       * (i.e., the array has more elements than the Vector),
662       * the element in the array immediately following the end of the       * the element in the array immediately following the end of the
663       * Vector is set to null.  (This is useful in determining the length       * Vector is set to null.  (This is useful in determining the length
# Line 668  Line 668 
668       *          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
669       *          same runtime type is allocated for this purpose.       *          same runtime type is allocated for this purpose.
670       * @return an array containing the elements of the Vector       * @return an array containing the elements of the Vector
671       * @exception ArrayStoreException the runtime type of a is not a supertype       * @throws ArrayStoreException the runtime type of a is not a supertype
672       * of the runtime type of every element in this Vector       * of the runtime type of every element in this Vector
673       * @throws NullPointerException if the given array is null       * @throws NullPointerException if the given array is null
674       * @since 1.2       * @since 1.2
# Line 1145  Line 1145 
1145       * equal, the returned List is empty.)  The returned List is backed by this       * equal, the returned List is empty.)  The returned List is backed by this
1146       * List, so changes in the returned List are reflected in this List, and       * List, so changes in the returned List are reflected in this List, and
1147       * vice-versa.  The returned List supports all of the optional List       * vice-versa.  The returned List supports all of the optional List
1148       * operations supported by this List.<p>       * operations supported by this List.
1149       *       *
1150       * This method eliminates the need for explicit range operations (of       * <p>This method eliminates the need for explicit range operations (of
1151       * the sort that commonly exist for arrays).   Any operation that expects       * the sort that commonly exist for arrays).   Any operation that expects
1152       * a List can be used as a range operation by operating on a subList view       * a List can be used as a range operation by operating on a subList view
1153       * instead of a whole List.  For example, the following idiom       * instead of a whole List.  For example, the following idiom
# Line 1157  Line 1157 
1157       * </pre>       * </pre>
1158       * Similar idioms may be constructed for indexOf and lastIndexOf,       * Similar idioms may be constructed for indexOf and lastIndexOf,
1159       * and all of the algorithms in the Collections class can be applied to       * and all of the algorithms in the Collections class can be applied to
1160       * a subList.<p>       * a subList.
1161       *       *
1162       * The semantics of the List returned by this method become undefined if       * <p>The semantics of the List returned by this method become undefined if
1163       * the backing list (i.e., this List) is <i>structurally modified</i> in       * the backing list (i.e., this List) is <i>structurally modified</i> in
1164       * any way other than via the returned List.  (Structural modifications are       * any way other than via the returned List.  (Structural modifications are
1165       * those that change the size of the List, or otherwise perturb it in such       * those that change the size of the List, or otherwise perturb it in such

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8