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
@Override public void accept(T t) { consumer.accept(t); } }
/** * If a value is present, performs the given action with the value, * otherwise does nothing. * * @param action the action to be performed, if a value is present * @throws NullPointerException if value is present and the given action is * {@code null} */ public void ifPresent(Consumer<? super T> action) { if (value != null) { action.accept(value); } }
@Override public void accept(T t) { delegate.accept(t); }
public void moveAll(PositionableList<T> otherList, Consumer<T> movedVisitor) { LinkedList<T> othersData = otherList.data; for (T othersDatum : othersData) { movedVisitor.accept(othersDatum); data.add(othersDatum); } othersData.clear(); }
@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); } }
public static void iterateChildren(File file, Consumer<File> consumer) { iterateChildrenEarlyStopping(file, child -> { consumer.accept(child); return false; }); }