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); |