< prev index next >

src/java.base/share/classes/java/util/ArrayDeque.java

Print this page

        

*** 315,324 **** --- 315,325 ---- * * @param c the elements to be inserted into this deque * @return {@code true} if this deque changed as a result of the call * @throws NullPointerException if the specified collection or any * of its elements are null + * @since 9 */ public boolean addAll(Collection<? extends E> c) { final int s, needed; if ((needed = (s = size()) + c.size() + 1 - elements.length) > 0) grow(needed);
*** 873,882 **** --- 874,884 ---- } } /** * @throws NullPointerException {@inheritDoc} + * @since 9 */ public void forEach(Consumer<? super E> action) { Objects.requireNonNull(action); final Object[] es = elements; for (int i = head, end = tail, to = (i <= end) ? end : es.length;
*** 890,915 **** --- 892,920 ---- } } /** * @throws NullPointerException {@inheritDoc} + * @since 9 */ public boolean removeIf(Predicate<? super E> filter) { Objects.requireNonNull(filter); return bulkRemove(filter); } /** * @throws NullPointerException {@inheritDoc} + * @since 9 */ public boolean removeAll(Collection<?> c) { Objects.requireNonNull(c); return bulkRemove(e -> c.contains(e)); } /** * @throws NullPointerException {@inheritDoc} + * @since 9 */ public boolean retainAll(Collection<?> c) { Objects.requireNonNull(c); return bulkRemove(e -> !c.contains(e)); }
< prev index next >