jdk/src/share/classes/java/util/List.java
changeset 20477 f7a1f6688508
parent 19435 9d7530ff42cb
child 21339 20e8b81964d5
equal deleted inserted replaced
20476:2d01671506ba 20477:f7a1f6688508
   394      * If the list's list-iterator does not support the {@code set} operation
   394      * If the list's list-iterator does not support the {@code set} operation
   395      * then an {@code UnsupportedOperationException} will be thrown when
   395      * then an {@code UnsupportedOperationException} will be thrown when
   396      * replacing the first element.
   396      * replacing the first element.
   397      *
   397      *
   398      * @param operator the operator to apply to each element
   398      * @param operator the operator to apply to each element
   399      * @throws UnsupportedOperationException if the {@code set}
   399      * @throws UnsupportedOperationException if this list is unmodifiable.
   400      *         operation is not supported by this list
   400      *         Implementations may throw this exception if an element
       
   401      *         cannot be replaced or if, in general, modification is not
       
   402      *         supported
   401      * @throws NullPointerException if the specified operator is null or
   403      * @throws NullPointerException if the specified operator is null or
   402      *         if the element is replaced with a null value and this list
   404      *         if the operator result is a null value and this list does
   403      *         does not permit null elements
   405      *         not permit null elements
   404      *         (<a href="Collection.html#optional-restrictions">optional</a>)
   406      *         (<a href="Collection.html#optional-restrictions">optional</a>)
   405      * @since 1.8
   407      * @since 1.8
   406      */
   408      */
   407     default void replaceAll(UnaryOperator<E> operator) {
   409     default void replaceAll(UnaryOperator<E> operator) {
   408         Objects.requireNonNull(operator);
   410         Objects.requireNonNull(operator);
   683     @Override
   685     @Override
   684     default Spliterator<E> spliterator() {
   686     default Spliterator<E> spliterator() {
   685         return Spliterators.spliterator(this, Spliterator.ORDERED);
   687         return Spliterators.spliterator(this, Spliterator.ORDERED);
   686     }
   688     }
   687 }
   689 }
   688