use of java.util.Spliterator in project Bytecoder by mirkosertic.
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;
}
use of java.util.Spliterator in project Bytecoder by mirkosertic.
the class IntPipeline method forEachWithCancel.
@Override
final boolean forEachWithCancel(Spliterator<Integer> spliterator, Sink<Integer> sink) {
Spliterator.OfInt spl = adapt(spliterator);
IntConsumer adaptedSink = adapt(sink);
boolean cancelled;
do {
} while (!(cancelled = sink.cancellationRequested()) && spl.tryAdvance(adaptedSink));
return cancelled;
}
use of java.util.Spliterator in project openj9 by eclipse.
the class StringStreams method testStringCharsSpliteratorEmpty.
@Test
public void testStringCharsSpliteratorEmpty() {
Spliterator.OfInt s = EMPTY.chars().spliterator();
final ArrayList<Integer> actualIntegers = new ArrayList<>();
s.forEachRemaining((IntConsumer) i -> actualIntegers.add(Integer.valueOf(i)));
checkDigitsOrdered(EMPTY, actualIntegers);
}
use of java.util.Spliterator in project openj9 by eclipse.
the class StringStreams method testStringCharsSpliteratorSplitting.
@Test
public void testStringCharsSpliteratorSplitting() {
OfInt s = DIGITS.chars().spliterator();
ArrayList<OfInt> sArray = new ArrayList<>();
while (Objects.nonNull(s)) {
sArray.add(s);
s = s.trySplit();
}
final HashSet<Integer> actualIntegers = new HashSet<>();
for (OfInt e : sArray) {
e.forEachRemaining((IntConsumer) i -> actualIntegers.add(Integer.valueOf(i)));
}
checkDigits(actualIntegers);
}
use of java.util.Spliterator in project openj9 by eclipse.
the class StringStreams method testStringCodePointsSpliterator.
@Test
public void testStringCodePointsSpliterator() {
Spliterator.OfInt s = DIGITS.chars().spliterator();
final ArrayList<Integer> actualIntegers = new ArrayList<>();
s.forEachRemaining((IntConsumer) i -> actualIntegers.add(Integer.valueOf(i)));
checkDigitsOrdered(DIGITS, actualIntegers);
}
Aggregations