Search in sources :

Example 6 with DoubleConsumer

use of java8.util.function.DoubleConsumer in project streamsupport by stefan-zobel.

the class DoublePipeline method forEachWithCancel.

@Override
final boolean forEachWithCancel(Spliterator<Double> spliterator, Sink<Double> sink) {
    Spliterator.OfDouble spl = adapt(spliterator);
    DoubleConsumer adaptedSink = adapt(sink);
    boolean cancelled;
    do {
    } while (!(cancelled = sink.cancellationRequested()) && spl.tryAdvance(adaptedSink));
    return cancelled;
}
Also used : ObjDoubleConsumer(java8.util.function.ObjDoubleConsumer) DoubleConsumer(java8.util.function.DoubleConsumer) Spliterator(java8.util.Spliterator)

Aggregations

DoubleConsumer (java8.util.function.DoubleConsumer)6 SplittableRandom (java8.util.SplittableRandom)4 LongAdder (java8.util.concurrent.atomic.LongAdder)3 NoSuchElementException (java.util.NoSuchElementException)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Spliterator (java8.util.Spliterator)1 ObjDoubleConsumer (java8.util.function.ObjDoubleConsumer)1