src/share/classes/java/util/Vector.java

Print this page
rev 7727 : 8020539: Clean up doclint problems in java.util package, part 2
Summary: Clean up doclint errors and warnings in classes in java.util
Reviewed-by: darcy,chegar
Contributed-by: Brian Burkhalter <brian.burkhalter@oracle.com>


  28 import java.util.function.Consumer;
  29 import java.util.function.Predicate;
  30 import java.util.function.UnaryOperator;
  31 
  32 /**
  33  * The {@code Vector} class implements a growable array of
  34  * objects. Like an array, it contains components that can be
  35  * accessed using an integer index. However, the size of a
  36  * {@code Vector} can grow or shrink as needed to accommodate
  37  * adding and removing items after the {@code Vector} has been created.
  38  *
  39  * <p>Each vector tries to optimize storage management by maintaining a
  40  * {@code capacity} and a {@code capacityIncrement}. The
  41  * {@code capacity} is always at least as large as the vector
  42  * size; it is usually larger because as components are added to the
  43  * vector, the vector's storage increases in chunks the size of
  44  * {@code capacityIncrement}. An application can increase the
  45  * capacity of a vector before inserting a large number of
  46  * components; this reduces the amount of incremental reallocation.
  47  *
  48  * <p><a name="fail-fast"/>
  49  * The iterators returned by this class's {@link #iterator() iterator} and
  50  * {@link #listIterator(int) listIterator} methods are <em>fail-fast</em>:
  51  * if the vector is structurally modified at any time after the iterator is
  52  * created, in any way except through the iterator's own
  53  * {@link ListIterator#remove() remove} or
  54  * {@link ListIterator#add(Object) add} methods, the iterator will throw a
  55  * {@link ConcurrentModificationException}.  Thus, in the face of
  56  * concurrent modification, the iterator fails quickly and cleanly, rather
  57  * than risking arbitrary, non-deterministic behavior at an undetermined
  58  * time in the future.  The {@link Enumeration Enumerations} returned by
  59  * the {@link #elements() elements} method are <em>not</em> fail-fast.
  60  *
  61  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  62  * as it is, generally speaking, impossible to make any hard guarantees in the
  63  * presence of unsynchronized concurrent modification.  Fail-fast iterators
  64  * throw {@code ConcurrentModificationException} on a best-effort basis.
  65  * Therefore, it would be wrong to write a program that depended on this
  66  * exception for its correctness:  <i>the fail-fast behavior of iterators
  67  * should be used only to detect bugs.</i>
  68  *
  69  * <p>As of the Java 2 platform v1.2, this class was retrofitted to
  70  * implement the {@link List} interface, making it a member of the




  28 import java.util.function.Consumer;
  29 import java.util.function.Predicate;
  30 import java.util.function.UnaryOperator;
  31 
  32 /**
  33  * The {@code Vector} class implements a growable array of
  34  * objects. Like an array, it contains components that can be
  35  * accessed using an integer index. However, the size of a
  36  * {@code Vector} can grow or shrink as needed to accommodate
  37  * adding and removing items after the {@code Vector} has been created.
  38  *
  39  * <p>Each vector tries to optimize storage management by maintaining a
  40  * {@code capacity} and a {@code capacityIncrement}. The
  41  * {@code capacity} is always at least as large as the vector
  42  * size; it is usually larger because as components are added to the
  43  * vector, the vector's storage increases in chunks the size of
  44  * {@code capacityIncrement}. An application can increase the
  45  * capacity of a vector before inserting a large number of
  46  * components; this reduces the amount of incremental reallocation.
  47  *
  48  * <p><a name="fail-fast">
  49  * The iterators returned by this class's {@link #iterator() iterator} and
  50  * {@link #listIterator(int) listIterator} methods are <em>fail-fast</em></a>:
  51  * if the vector is structurally modified at any time after the iterator is
  52  * created, in any way except through the iterator's own
  53  * {@link ListIterator#remove() remove} or
  54  * {@link ListIterator#add(Object) add} methods, the iterator will throw a
  55  * {@link ConcurrentModificationException}.  Thus, in the face of
  56  * concurrent modification, the iterator fails quickly and cleanly, rather
  57  * than risking arbitrary, non-deterministic behavior at an undetermined
  58  * time in the future.  The {@link Enumeration Enumerations} returned by
  59  * the {@link #elements() elements} method are <em>not</em> fail-fast.
  60  *
  61  * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
  62  * as it is, generally speaking, impossible to make any hard guarantees in the
  63  * presence of unsynchronized concurrent modification.  Fail-fast iterators
  64  * throw {@code ConcurrentModificationException} on a best-effort basis.
  65  * Therefore, it would be wrong to write a program that depended on this
  66  * exception for its correctness:  <i>the fail-fast behavior of iterators
  67  * should be used only to detect bugs.</i>
  68  *
  69  * <p>As of the Java 2 platform v1.2, this class was retrofitted to
  70  * implement the {@link List} interface, making it a member of the