public void forEach(Consumer<? super T> action, long fence) { for (int i = 0; i < fence; i++) { @SuppressWarnings("unchecked") T t = (T) array[i]; action.accept(t); } } }
@Override public void forEach(Consumer<? super T> consumer) { for (int i = 0; i < curSize; i++) { consumer.accept(array[i]); } }
public void forEach(Consumer<? super T> action, long fence) { for (int i = 0; i < fence; i++) { @SuppressWarnings("unchecked") T t = (T) array[i]; action.accept(t); } } }
@Override public void accept(E_OUT t) { sink.accept(t); } @Override
@Override public void forEach(Consumer<? super T> consumer) { for (int i = 0; i < curSize; i++) { consumer.accept(array[i]); } }
@Override public void accept(E_OUT t) { sink.accept(t); } @Override
@SuppressWarnings("unchecked") @Override public void forEachRemaining(Consumer<? super T> action) { Objects.requireNonNull(action); Object[] a; int i, hi; // hoist accesses and checks from loop if ((a = array).length >= (hi = fence) && (i = index) >= 0 && i < (index = hi)) { do { action.accept((T)a[i]); } while (++i < hi); } }
@Override public boolean tryAdvance(Consumer<? super T> action) { Objects.requireNonNull(action); if (index >= 0 && index < fence) { @SuppressWarnings("unchecked") T e = (T) array[index++]; action.accept(e); return true; } return false; }
@Override public void forEachRemaining(Consumer<? super T> action) { Objects.requireNonNull(action); if (count == -2) { action.accept(first); count = -1; } } }
@Override public boolean tryAdvance(Consumer<? super T> action) { Objects.requireNonNull(action); if (count == -2) { action.accept(first); count = -1; return true; } else { return false; } }
@SuppressWarnings("unchecked") @Override public void forEachRemaining(Consumer<? super T> action) { Objects.requireNonNull(action); Object[] a; int i, hi; // hoist accesses and checks from loop if ((a = array).length >= (hi = fence) && (i = index) >= 0 && i < (index = hi)) { do { action.accept((T)a[i]); } while (++i < hi); } }
@Override public void forEachRemaining(Consumer<? super T> action) { Objects.requireNonNull(action); if (count == -2) { action.accept(first); count = -1; } } }
@Override public void forEach(Consumer<? super T> consumer) { Objects.requireNonNull(consumer); for (T t : c) { consumer.accept(t); } }
@Override public void forEachRemaining(Consumer<? super T> action) { s.forEachRemaining(t -> { if (seen.putIfAbsent(mapNull(t), Boolean.TRUE) == null) { action.accept(t); } }); }
@Override @SuppressWarnings("unchecked") public void forEachRemaining(Consumer<? super E> action) { Objects.requireNonNull(action); int hi = getFence(), lo = index; Object[] es = array; index = hi; // ensure exhaustion for (int i = lo; i < hi; i++) action.accept((E) es[i]); }
@Override @SuppressWarnings("unchecked") public void forEachRemaining(Consumer<? super E> action) { Objects.requireNonNull(action); int hi = getFence(), lo = index; Object[] a = array; index = hi; // ensure exhaustion for (int i = lo; i < hi; i++) action.accept((E) a[i]); }
public final void onNext(T item) { try { consumer.accept(item); } catch (Throwable ex) { subscription.cancel(); status.completeExceptionally(ex); } } }
public boolean tryAdvance(Consumer<? super E> action) { Objects.requireNonNull(action); int hi = getFence(), i = index; if (i < hi) { index = i + 1; action.accept(list.get(i)); checkAbsListModCount(alist, expectedModCount); return true; } return false; }