@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 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; }
public void forEachRemaining(LongConsumer consumer) { Objects.requireNonNull(consumer); long i = index, f = fence; if (i < f) { index = f; SplittableRandom r = rng; long o = origin, b = bound; do { consumer.accept(r.internalNextLong(o, b)); } while (++i < f); } }
@Override public boolean tryAdvance(LongConsumer action) { Objects.requireNonNull(action); action.accept(s.getAsLong()); return true; }
public boolean tryAdvance(LongConsumer consumer) { Objects.requireNonNull(consumer); long i = index, f = fence; if (i < f) { consumer.accept(ThreadLocalRandom.current().internalNextLong(origin, bound)); index = i + 1; return true; } return false; }
public void forEachRemaining(LongConsumer consumer) { Objects.requireNonNull(consumer); long i = index, f = fence; if (i < f) { index = f; long o = origin, b = bound; ThreadLocalRandom rng = ThreadLocalRandom.current(); do { consumer.accept(rng.internalNextLong(o, b)); } while (++i < f); } }
public boolean tryAdvance(LongConsumer consumer) { Objects.requireNonNull(consumer); long i = index, f = fence; if (i < f) { consumer.accept(rng.internalNextLong(origin, bound)); index = i + 1; return true; } return false; }
public boolean tryAdvance(LongConsumer consumer) { Objects.requireNonNull(consumer); long i = index, f = fence; if (i < f) { consumer.accept(ThreadLocalRandom.current().internalNextLong(origin, bound)); index = i + 1; return true; } return false; }
@Override public boolean tryAdvance(LongConsumer action) { Objects.requireNonNull(action); if (it.hasNext()) { action.accept(it.nextLong()); return true; } return false; }