src/share/classes/java/util/List.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>


 367      * @throws ClassCastException if the class of an element of this list
 368      *         is incompatible with the specified collection
 369      * (<a href="Collection.html#optional-restrictions">optional</a>)
 370      * @throws NullPointerException if this list contains a null element and the
 371      *         specified collection does not permit null elements
 372      *         (<a href="Collection.html#optional-restrictions">optional</a>),
 373      *         or if the specified collection is null
 374      * @see #remove(Object)
 375      * @see #contains(Object)
 376      */
 377     boolean retainAll(Collection<?> c);
 378 
 379     /**
 380      * Replaces each element of this list with the result of applying the
 381      * operator to that element.  Errors or runtime exceptions thrown by
 382      * the operator are relayed to the caller.
 383      *
 384      * @implSpec
 385      * The default implementation is equivalent to, for this {@code list}:
 386      * <pre>

 387      * final ListIterator<E> li = list.listIterator();
 388      * while (li.hasNext()) {
 389      *   li.set(operator.apply(li.next()));
 390      * }

 391      * </pre>
 392      * If the list's list-iterator does not support the {@code set} operation
 393      * then an {@code UnsupportedOperationException} will be thrown when
 394      * replacing the first element.
 395      *
 396      * @param operator the operator to apply to each element
 397      * @throws UnsupportedOperationException if the {@code set}
 398      *         operation is not supported by this list
 399      * @throws NullPointerException if the specified operator is null or
 400      *         if the element is replaced with a null value and this list
 401      *         does not permit null elements
 402      *         (<a href="Collection.html#optional-restrictions">optional</a>)
 403      * @since 1.8
 404      */
 405     default void replaceAll(UnaryOperator<E> operator) {
 406         Objects.requireNonNull(operator);
 407         final ListIterator<E> li = this.listIterator();
 408         while (li.hasNext()) {
 409             li.set(operator.apply(li.next()));
 410         }




 367      * @throws ClassCastException if the class of an element of this list
 368      *         is incompatible with the specified collection
 369      * (<a href="Collection.html#optional-restrictions">optional</a>)
 370      * @throws NullPointerException if this list contains a null element and the
 371      *         specified collection does not permit null elements
 372      *         (<a href="Collection.html#optional-restrictions">optional</a>),
 373      *         or if the specified collection is null
 374      * @see #remove(Object)
 375      * @see #contains(Object)
 376      */
 377     boolean retainAll(Collection<?> c);
 378 
 379     /**
 380      * Replaces each element of this list with the result of applying the
 381      * operator to that element.  Errors or runtime exceptions thrown by
 382      * the operator are relayed to the caller.
 383      *
 384      * @implSpec
 385      * The default implementation is equivalent to, for this {@code list}:
 386      * <pre>
 387      * {@code
 388      * final ListIterator<E> li = list.listIterator();
 389      * while (li.hasNext()) {
 390      *   li.set(operator.apply(li.next()));
 391      * }
 392      * }
 393      * </pre>
 394      * If the list's list-iterator does not support the {@code set} operation
 395      * then an {@code UnsupportedOperationException} will be thrown when
 396      * replacing the first element.
 397      *
 398      * @param operator the operator to apply to each element
 399      * @throws UnsupportedOperationException if the {@code set}
 400      *         operation is not supported by this list
 401      * @throws NullPointerException if the specified operator is null or
 402      *         if the element is replaced with a null value and this list
 403      *         does not permit null elements
 404      *         (<a href="Collection.html#optional-restrictions">optional</a>)
 405      * @since 1.8
 406      */
 407     default void replaceAll(UnaryOperator<E> operator) {
 408         Objects.requireNonNull(operator);
 409         final ListIterator<E> li = this.listIterator();
 410         while (li.hasNext()) {
 411             li.set(operator.apply(li.next()));
 412         }