[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.14, Sun Jun 25 19:41:52 2006 UTC revision 1.15, Sun Jun 25 19:58:14 2006 UTC
# Line 63  Line 63 
63      /**      /**
64       * The array buffer into which the components of the vector are       * The array buffer into which the components of the vector are
65       * stored. The capacity of the vector is the length of this array buffer,       * stored. The capacity of the vector is the length of this array buffer,
66       * and is at least large enough to contain all the vector's elements.<p>       * and is at least large enough to contain all the vector's elements.
67       *       *
68       * Any array elements following the last element in the Vector are null.       * <p>Any array elements following the last element in the Vector are null.
69       *       *
70       * @serial       * @serial
71       */       */
# Line 100  Line 100 
100       * @param   initialCapacity     the initial capacity of the vector       * @param   initialCapacity     the initial capacity of the vector
101       * @param   capacityIncrement   the amount by which the capacity is       * @param   capacityIncrement   the amount by which the capacity is
102       *                              increased when the vector overflows       *                              increased when the vector overflows
103       * @exception IllegalArgumentException if the specified initial capacity       * @throws IllegalArgumentException if the specified initial capacity
104       *               is negative       *               is negative
105       */       */
106      public Vector(int initialCapacity, int capacityIncrement) {      public Vector(int initialCapacity, int capacityIncrement) {
# Line 117  Line 117 
117       * with its capacity increment equal to zero.       * with its capacity increment equal to zero.
118       *       *
119       * @param   initialCapacity   the initial capacity of the vector       * @param   initialCapacity   the initial capacity of the vector
120       * @exception IllegalArgumentException if the specified initial capacity       * @throws IllegalArgumentException if the specified initial capacity
121       *               is negative       *               is negative
122       */       */
123      public Vector(int initialCapacity) {      public Vector(int initialCapacity) {
# Line 212  Line 212 
212       * method for ensuring capacity without incurring the cost of an       * method for ensuring capacity without incurring the cost of an
213       * extra synchronization.       * extra synchronization.
214       *       *
215       * @see java.util.Vector#ensureCapacity(int)       * @see #ensureCapacity(int)
216       */       */
217      private void ensureCapacityHelper(int minCapacity) {      private void ensureCapacityHelper(int minCapacity) {
218          int oldCapacity = elementData.length;          int oldCapacity = elementData.length;
# Line 286  Line 286 
286       * then the item at index {@code 1}, and so on.       * then the item at index {@code 1}, and so on.
287       *       *
288       * @return  an enumeration of the components of this vector       * @return  an enumeration of the components of this vector
      * @see     Enumeration  
289       * @see     Iterator       * @see     Iterator
290       */       */
291      public Enumeration<E> elements() {      public Enumeration<E> elements() {
# Line 413  Line 412 
412      }      }
413    
414      /**      /**
415       * Returns the component at the specified index.<p>       * Returns the component at the specified index.
416       *       *
417       * This method is identical in functionality to the get method       * <p>This method is identical in functionality to the {@link #get(int)}
418       * (which is part of the List interface).       * method (which is part of the {@link List} interface).
419       *       *
420       * @param      index   an index into this vector       * @param      index   an index into this vector
421       * @return     the component at the specified index       * @return     the component at the specified index
422       * @exception  ArrayIndexOutOfBoundsException  if the {@code index}       * @throws ArrayIndexOutOfBoundsException if the index is out of range
423       *             is negative or not less than the current size of this       *         ({@code index < 0 || index >= size()})
      *             {@code Vector} object.  
      * @see        #get(int)  
      * @see        List  
424       */       */
425      public synchronized E elementAt(int index) {      public synchronized E elementAt(int index) {
426          if (index >= elementCount) {          if (index >= elementCount) {
# Line 439  Line 435 
435       * this vector.       * this vector.
436       *       *
437       * @return     the first component of this vector       * @return     the first component of this vector
438       * @exception  NoSuchElementException  if this vector has no components       * @throws NoSuchElementException if this vector has no components
439       */       */
440      public synchronized E firstElement() {      public synchronized E firstElement() {
441          if (elementCount == 0) {          if (elementCount == 0) {
# Line 453  Line 449 
449       *       *
450       * @return  the last component of the vector, i.e., the component at index       * @return  the last component of the vector, i.e., the component at index
451       *          <code>size()&nbsp;-&nbsp;1</code>.       *          <code>size()&nbsp;-&nbsp;1</code>.
452       * @exception  NoSuchElementException  if this vector is empty       * @throws NoSuchElementException if this vector is empty
453       */       */
454      public synchronized E lastElement() {      public synchronized E lastElement() {
455          if (elementCount == 0) {          if (elementCount == 0) {
# Line 478  Line 474 
474       *       *
475       * @param      obj     what the component is to be set to       * @param      obj     what the component is to be set to
476       * @param      index   the specified index       * @param      index   the specified index
477       * @exception  ArrayIndexOutOfBoundsException  if the index was invalid       * @throws  ArrayIndexOutOfBoundsException  if the index was invalid
478       * @see        #size()       * @see        #size()
479       * @see        List       * @see        List
480       * @see        #set(int, java.lang.Object)       * @see        #set(int, java.lang.Object)
# Line 496  Line 492 
492       * this vector with an index greater or equal to the specified       * this vector with an index greater or equal to the specified
493       * {@code index} is shifted downward to have an index one       * {@code index} is shifted downward to have an index one
494       * smaller than the value it had previously. The size of this vector       * smaller than the value it had previously. The size of this vector
495       * is decreased by {@code 1}.<p>       * is decreased by {@code 1}.
496       *       *
497       * 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}
498       * and less than the current size of the vector. <p>       * and less than the current size of the vector.
499       *       *
500       * This method is identical in functionality to the remove method       * <p>This method is identical in functionality to the remove method
501       * (which is part of the List interface).  Note that the remove method       * (which is part of the List interface).  Note that the remove method
502       * returns the old value that was stored at the specified position.       * returns the old value that was stored at the specified position.
503       *       *
# Line 533  Line 529 
529       * specified {@code index}. Each component in this vector with       * specified {@code index}. Each component in this vector with
530       * an index greater or equal to the specified {@code index} is       * an index greater or equal to the specified {@code index} is
531       * shifted upward to have an index one greater than the value it had       * shifted upward to have an index one greater than the value it had
532       * previously. <p>       * previously.
533       *       *
534       * 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}
535       * and less than or equal to the current size of the vector. (If the       * and less than or equal to the current size of the vector. (If the
536       * 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
537       * is appended to the Vector.)<p>       * is appended to the Vector.)
538       *       *
539       * This method is identical in functionality to the add(Object, int) method       * <p>This method is identical in functionality to the add(Object, int) method
540       * (which is part of the List interface). Note that the add method reverses       * (which is part of the List interface). Note that the add method reverses
541       * the order of the parameters, to more closely match array usage.       * the order of the parameters, to more closely match array usage.
542       *       *

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8