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