@Override protected void acceptConsumed(DoubleConsumer action) { action.accept(tmpValue); }
@Override public void accept(double value) { consumer.accept(value); } @Override
@Override protected void arrayForEach(double[] array, int from, int to, DoubleConsumer consumer) { for (int i = from; i < to; i++) consumer.accept(array[i]); }
@Override public void accept(double value) { consumer.accept(value); } @Override
@Override void forEach(DoubleConsumer action, long fence) { for (int i = 0; i < fence; i++) { action.accept(array[i]); } } }
@Override public void forEach(DoubleConsumer consumer) { for (int i = 0; i < curSize; i++) { consumer.accept(array[i]); } }
@Override protected void arrayForEach(double[] array, int from, int to, DoubleConsumer consumer) { for (int i = from; i < to; i++) consumer.accept(array[i]); }
@Override void forEach(DoubleConsumer action, long fence) { for (int i = 0; i < fence; i++) { action.accept(array[i]); } } }
@Override protected void acceptConsumed(DoubleConsumer action) { action.accept(tmpValue); }
@Override public void forEach(DoubleConsumer consumer) { for (int i = 0; i < curSize; i++) { consumer.accept(array[i]); } }
/** * 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(DoubleConsumer action) { if (isPresent) { action.accept(value); } }
@Override public void accept(double t) { consumer.accept(t); }
@Override public void accept(double 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(DoubleConsumer action) { if (isPresent) { action.accept(value); } }
@Override public void forEachRemaining(DoubleConsumer action) { double[] a; int i, hi; // hoist accesses and checks from loop Objects.requireNonNull(action); if ((a = array).length >= (hi = fence) && (i = index) >= 0 && i < (index = hi)) { do { action.accept(a[i]); } while (++i < hi); } }
@Override public boolean tryAdvance(DoubleConsumer action) { Objects.requireNonNull(action); if (count == -2) { action.accept(first); count = -1; return true; } else { return false; } }
@Override public boolean tryAdvance(DoubleConsumer action) { Objects.requireNonNull(action); if (index >= 0 && index < fence) { action.accept(array[index++]); return true; } return false; }
@Override public void forEachRemaining(DoubleConsumer action) { Objects.requireNonNull(action); if (count == -2) { action.accept(first); count = -1; } }
@Override public boolean tryAdvance(DoubleConsumer action) { Objects.requireNonNull(action); if (count == -2) { action.accept(first); count = -1; return true; } else { return false; } }
@Override public boolean tryAdvance(DoubleConsumer action) { Objects.requireNonNull(action); if (index >= 0 && index < fence) { action.accept(array[index++]); return true; } return false; }