/** * Returns whether this stream, if a terminal operation were to be executed, * would execute in parallel. Calling this method after invoking an * terminal stream operation method may yield unpredictable results. * * @return {@code true} if this stream would execute in parallel if executed */ @Override public boolean isParallel() { return inner.isParallel(); }
checkNotNull(consumer); if (streamA.isParallel() || streamB.isParallel()) { zip(streamA, streamB, TemporaryPair::new).forEach(pair -> consumer.accept(pair.a, pair.b)); } else {
@Override public boolean isParallel() { return stream().isParallel(); }
checkNotNull(consumer); if (streamA.isParallel() || streamB.isParallel()) { zip(streamA, streamB, TemporaryPair::new).forEach(pair -> consumer.accept(pair.a, pair.b)); } else {
checkNotNull(consumer); if (streamA.isParallel() || streamB.isParallel()) { zip(streamA, streamB, TemporaryPair::new).forEach(pair -> consumer.accept(pair.a, pair.b)); } else {
private static <T, R> Stream<R> withIndex(Stream<T> stream, FunctionWithIndex<T, R> function) { assert !stream.isParallel(); final Iterator<T> iterator = stream.iterator(); final Iterator<R> returnIterator = new Iterator<R>() { private int index = 0; @Override public boolean hasNext() { return iterator.hasNext(); } @Override public R next() { return function.apply(iterator.next(), index++); } }; return iteratorToFiniteStream(returnIterator); }
checkNotNull(consumer); if (streamA.isParallel() || streamB.isParallel()) { zip(streamA, streamB, TemporaryPair::new).forEach(pair -> consumer.accept(pair.a, pair.b)); } else {
new ImmutableList.Builder<>(streams.length); for (Stream<? extends T> stream : streams) { isParallel |= stream.isParallel(); Spliterator<? extends T> splitr = stream.spliterator(); splitrsBuilder.add(splitr);
checkNotNull(streamB); checkNotNull(function); boolean isParallel = streamA.isParallel() || streamB.isParallel(); // same as Stream.concat Spliterator<A> splitrA = streamA.spliterator(); Spliterator<B> splitrB = streamB.spliterator();
checkNotNull(stream); checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator<T> fromSpliterator = stream.spliterator();
new ImmutableList.Builder<>(streams.length); for (Stream<? extends T> stream : streams) { isParallel |= stream.isParallel(); Spliterator<? extends T> splitr = stream.spliterator(); splitrsBuilder.add(splitr);
checkNotNull(streamB); checkNotNull(function); boolean isParallel = streamA.isParallel() || streamB.isParallel(); // same as Stream.concat Spliterator<A> splitrA = streamA.spliterator(); Spliterator<B> splitrB = streamB.spliterator();
new ImmutableList.Builder<>(streams.length); for (Stream<? extends T> stream : streams) { isParallel |= stream.isParallel(); Spliterator<? extends T> splitr = stream.spliterator(); splitrsBuilder.add(splitr);
checkNotNull(streamB); checkNotNull(function); boolean isParallel = streamA.isParallel() || streamB.isParallel(); // same as Stream.concat Spliterator<A> splitrA = streamA.spliterator(); Spliterator<B> splitrB = streamB.spliterator();
checkNotNull(stream); checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator<T> fromSpliterator = stream.spliterator();
checkNotNull(stream); checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator<T> fromSpliterator = stream.spliterator();
checkNotNull(streamB); checkNotNull(function); boolean isParallel = streamA.isParallel() || streamB.isParallel(); // same as Stream.concat Spliterator<A> splitrA = streamA.spliterator(); Spliterator<B> splitrB = streamB.spliterator();
checkNotNull(stream); checkNotNull(function); boolean isParallel = stream.isParallel(); Spliterator<T> fromSpliterator = stream.spliterator();
new ImmutableList.Builder<>(streams.length); for (Stream<? extends T> stream : streams) { isParallel |= stream.isParallel(); Spliterator<? extends T> splitr = stream.spliterator(); splitrsBuilder.add(splitr);
public final static <T> Stream<Seq<T>> groupedByTime(final Stream<T> stream, final long time, final TimeUnit t) { return StreamSupport.stream(new GroupedByTimeSpliterator(stream.spliterator(),()->Seq.fromIterable(new ArrayList<>()), Function.identity(),time,t),stream.isParallel()); } @Deprecated