APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.util.stream

pack-priv abstract Class ReferencePipeline<P_IN, P_OUT>

extends AbstractPipeline<P_IN, P_OUT, Stream<P_OUT>>
implements Stream<P_OUT>
Class Inheritance
All Implemented Interfaces
java.util.stream.Stream, java.util.stream.BaseStream, java.lang.AutoCloseable
Known Direct Subclasses
java.util.stream.ReferencePipeline.Head, java.util.stream.ReferencePipeline.StatelessOp, java.util.stream.ReferencePipeline.StatefulOp, java.util.stream.GathererOp
Type Parameters
<P_IN>
type of elements in the upstream source
<P_OUT>
type of elements in produced by this stage
Imports
java.util.Comparator, .Iterator, .List, .Objects, .Optional, .Spliterator, .Spliterators, java.util.function.BiConsumer, .BiFunction, .BinaryOperator, .Consumer, .DoubleConsumer, .DoublePredicate, .Function, .IntConsumer, .IntFunction, .IntPredicate, .LongConsumer, .LongPredicate, .Predicate, .Supplier, .ToDoubleFunction, .ToIntFunction, .ToLongFunction, jdk.internal.access.SharedSecrets

Abstract base class for an intermediate pipeline stage or pipeline source stage implementing whose elements are of type U.
Since
1.8

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
ReferencePipeline.Head<
type of elements in the upstream source
E_IN
,
type of elements in produced by this stage
E_OUT
>

Source stage of a ReferencePipeline.

pack-priv abstract static class
ReferencePipeline.StatefulOp<
type of elements in the upstream source
E_IN
,
type of elements in produced by this stage
E_OUT
>

Base class for a stateful intermediate stage of a Stream.

pack-priv abstract static class
ReferencePipeline.StatelessOp<
type of elements in the upstream source
E_IN
,
type of elements in produced by this stage
E_OUT
>

Base class for a stateless intermediate stage of a Stream.

Field Summary

Inherited from java.util.stream.AbstractPipeline:
previousStagesourceOrOpFlags

Constructor Summary

AccessConstructor and Description
pack-priv
ReferencePipeline(Supplier<? extends Spliterator<?>>
Supplier<Spliterator> describing the stream source
source
,
int
the source flags for the stream source, described in StreamOpFlag
sourceFlags
,
boolean
true if the pipeline is parallel
parallel
)

Constructor for the head of a stream pipeline.

pack-priv
ReferencePipeline(Spliterator<?>
Spliterator describing the stream source
source
,
int
The source flags for the stream source, described in StreamOpFlag
sourceFlags
,
boolean
true if the pipeline is parallel
parallel
)

Constructor for the head of a stream pipeline.

pack-priv
ReferencePipeline(AbstractPipeline<?, P_IN, ?>
the upstream element source
upstream
,
int
The operation flags for this operation, described in StreamOpFlag
opFlags
)

Constructor for appending an intermediate operation onto an existing pipeline.

protected
ReferencePipeline(AbstractPipeline<?, P_IN, ?>
the upstream of the upstream element source
upupstream
,
AbstractPipeline<?, P_IN, ?>
the upstream element source
upstream
,
int
The operation flags for this operation, described in StreamOpFlag
opFlags
)

Constructor for appending an intermediate operation onto an existing pipeline.

Method Summary

Modifier and TypeMethod and Description
public final boolean
allMatch(Predicate<? super P_OUT> predicate)

Implements java.util.stream.Stream.allMatch.

Returns whether all elements of this stream match the provided predicate.

public final boolean
anyMatch(Predicate<? super P_OUT> predicate)

Implements java.util.stream.Stream.anyMatch.

Returns whether any elements of this stream match the provided predicate.

public <R, A> R
collect(Collector<? super P_OUT, A, R> collector)

Implements java.util.stream.Stream.collect.

Performs a mutable reduction operation on the elements of this stream using a Collector.

public <R> R
collect(Supplier<R> supplier, BiConsumer<R, ? super P_OUT> accumulator, BiConsumer<R, R> combiner)

Implements java.util.stream.Stream.collect.

Performs a mutable reduction operation on the elements of this stream.

public final long
count()

Implements java.util.stream.Stream.count.

Returns the count of elements in this stream.

public final Stream<P_OUT>
distinct()

Implements java.util.stream.Stream.distinct.

Returns a stream consisting of the distinct elements (according to Object#equals(Object)) of this stream.

public final Stream<P_OUT>
dropWhile(Predicate<? super P_OUT> predicate)

Overrides default java.util.stream.Stream.dropWhile.

Returns, if this stream is ordered, a stream consisting of the remaining elements of this stream after dropping the longest prefix of elements that match the given predicate.

pack-priv final <P_IN> Node<P_OUT>
evaluateToNode(PipelineHelper<P_OUT> helper, Spliterator<P_IN> spliterator, boolean flattenTree, IntFunction<P_OUT[]> generator)

Implements abstract java.util.stream.AbstractPipeline.evaluateToNode.

Collect elements output from a pipeline into a Node that holds elements of this shape.

public final Stream<P_OUT>
filter(Predicate<? super P_OUT> predicate)

Implements java.util.stream.Stream.filter.

Returns a stream consisting of the elements of this stream that match the given predicate.

public final Optional<P_OUT>
findAny()

Implements java.util.stream.Stream.findAny.

Returns an Optional describing some element of the stream, or an empty Optional if the stream is empty.

public final Optional<P_OUT>
findFirst()

Implements java.util.stream.Stream.findFirst.

Returns an Optional describing the first element of this stream, or an empty Optional if the stream is empty.

public final <R> Stream<R>
flatMap(Function<? super P_OUT, ? extends Stream<? extends R>> mapper)

Implements java.util.stream.Stream.flatMap.

Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.

public final DoubleStream
flatMapToDouble(Function<? super P_OUT, ? extends DoubleStream> mapper)

Implements java.util.stream.Stream.flatMapToDouble.

Returns an DoubleStream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.

public final IntStream
flatMapToInt(Function<? super P_OUT, ? extends IntStream> mapper)

Implements java.util.stream.Stream.flatMapToInt.

Returns an IntStream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.

public final LongStream
flatMapToLong(Function<? super P_OUT, ? extends LongStream> mapper)

Implements java.util.stream.Stream.flatMapToLong.

Returns an LongStream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.

public void
forEach(Consumer<? super P_OUT> action)

Implements java.util.stream.Stream.forEach.

Performs an action for each element of this stream.

public void
forEachOrdered(Consumer<? super P_OUT> action)

Implements java.util.stream.Stream.forEachOrdered.

Performs an action for each element of this stream, in the encounter order of the stream if the stream has a defined encounter order.

pack-priv final boolean
forEachWithCancel(Spliterator<P_OUT> spliterator, Sink<P_OUT> sink)

Implements abstract java.util.stream.AbstractPipeline.forEachWithCancel.

Traverse the elements of a spliterator compatible with this stream shape, pushing those elements into a sink.

public final <R> Stream<R>
gather(Gatherer<? super P_OUT, ?, R> gatherer)

Overrides default java.util.stream.Stream.gather.

Returns a stream consisting of the results of applying the given Gatherer to the elements of this stream.

pack-priv final StreamShape
getOutputShape()

Implements abstract java.util.stream.AbstractPipeline.getOutputShape.

Get the output shape of the pipeline.

public final Iterator<P_OUT>
iterator()

Implements java.util.stream.BaseStream.iterator.

Returns an iterator for the elements of this stream.

pack-priv final Spliterator<P_OUT>
lazySpliterator(Supplier<? extends Spliterator<P_OUT>> supplier)

Implements abstract java.util.stream.AbstractPipeline.lazySpliterator.

Create a lazy spliterator that wraps and obtains the supplied the spliterator when a method is invoked on the lazy spliterator.

public final Stream<P_OUT>
limit(long maxSize)

Implements java.util.stream.Stream.limit.

Returns a stream consisting of the elements of this stream, truncated to be no longer than maxSize in length.

pack-priv final Node.Builder<P_OUT>
makeNodeBuilder(long exactSizeIfKnown, IntFunction<P_OUT[]> generator)

Implements abstract java.util.stream.AbstractPipeline.makeNodeBuilder.

Make a node builder compatible with this stream shape.

public final <R> Stream<R>
map(Function<? super P_OUT, ? extends R> mapper)

Implements java.util.stream.Stream.map.

Returns a stream consisting of the results of applying the given function to the elements of this stream.

public final <R> Stream<R>
mapMulti(BiConsumer<? super P_OUT, ? super Consumer<R>> mapper)

Overrides default java.util.stream.Stream.mapMulti.

Returns a stream consisting of the results of replacing each element of this stream with multiple elements, specifically zero or more elements.

public final DoubleStream
mapMultiToDouble(BiConsumer<? super P_OUT, ? super DoubleConsumer> mapper)

Overrides default java.util.stream.Stream.mapMultiToDouble.

Returns a DoubleStream consisting of the results of replacing each element of this stream with multiple elements, specifically zero or more elements.

public final IntStream
mapMultiToInt(BiConsumer<? super P_OUT, ? super IntConsumer> mapper)

Overrides default java.util.stream.Stream.mapMultiToInt.

Returns an IntStream consisting of the results of replacing each element of this stream with multiple elements, specifically zero or more elements.

public final LongStream
mapMultiToLong(BiConsumer<? super P_OUT, ? super LongConsumer> mapper)

Overrides default java.util.stream.Stream.mapMultiToLong.

Returns a LongStream consisting of the results of replacing each element of this stream with multiple elements, specifically zero or more elements.

public final DoubleStream
mapToDouble(ToDoubleFunction<? super P_OUT> mapper)

Implements java.util.stream.Stream.mapToDouble.

Returns a DoubleStream consisting of the results of applying the given function to the elements of this stream.

public final IntStream
mapToInt(ToIntFunction<? super P_OUT> mapper)

Implements java.util.stream.Stream.mapToInt.

Returns an IntStream consisting of the results of applying the given function to the elements of this stream.

public final LongStream
mapToLong(ToLongFunction<? super P_OUT> mapper)

Implements java.util.stream.Stream.mapToLong.

Returns a LongStream consisting of the results of applying the given function to the elements of this stream.

public final Optional<P_OUT>
max(Comparator<? super P_OUT> comparator)

Implements java.util.stream.Stream.max.

Returns the maximum element of this stream according to the provided Comparator.

public final Optional<P_OUT>
min(Comparator<? super P_OUT> comparator)

Implements java.util.stream.Stream.min.

Returns the minimum element of this stream according to the provided Comparator.

public final boolean
noneMatch(Predicate<? super P_OUT> predicate)

Implements java.util.stream.Stream.noneMatch.

Returns whether no elements of this stream match the provided predicate.

public final Stream<P_OUT>
peek(Consumer<? super P_OUT> action)

Implements java.util.stream.Stream.peek.

Returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream.

public final P_OUT
reduce(final P_OUT identity, final BinaryOperator<P_OUT> accumulator)

Implements java.util.stream.Stream.reduce.

Performs a reduction on the elements of this stream, using the provided identity value and an associative accumulation function, and returns the reduced value.

public final Optional<P_OUT>
reduce(BinaryOperator<P_OUT> accumulator)

Implements java.util.stream.Stream.reduce.

Performs a reduction on the elements of this stream, using an associative accumulation function, and returns an Optional describing the reduced value, if any.

public final <R> R
reduce(R identity, BiFunction<R, ? super P_OUT, R> accumulator, BinaryOperator<R> combiner)

Implements java.util.stream.Stream.reduce.

Performs a reduction on the elements of this stream using the provided identity value, accumulation function, and combining function.

public final Stream<P_OUT>
skip(long n)

Implements java.util.stream.Stream.skip.

Returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream.

public final Stream<P_OUT>
sorted()

Implements java.util.stream.Stream.sorted.

Returns a stream consisting of the elements of this stream, sorted according to natural order.

public final Stream<P_OUT>
sorted(Comparator<? super P_OUT> comparator)

Implements java.util.stream.Stream.sorted.

Returns a stream consisting of the elements of this stream, sorted according to the provided Comparator.

public final Stream<P_OUT>
takeWhile(Predicate<? super P_OUT> predicate)

Overrides default java.util.stream.Stream.takeWhile.

Returns, if this stream is ordered, a stream consisting of the longest prefix of elements taken from this stream that match the given predicate.

public final <A> A[]
toArray(IntFunction<A[]> generator)

Implements java.util.stream.Stream.toArray.

Returns an array containing the elements of this stream, using the provided generator function to allocate the returned array, as well as any additional arrays that might be required for a partitioned execution or for resizing.

public final Object[]
toArray()

Implements java.util.stream.Stream.toArray.

Returns an array containing the elements of this stream.

public List<P_OUT>
toList()

Overrides default java.util.stream.Stream.toList.

Accumulates the elements of this stream into a List.

public Stream<P_OUT>
unordered()

Implements java.util.stream.BaseStream.unordered.

Returns an equivalent stream that is unordered.

pack-priv final <P_IN> Spliterator<P_OUT>
wrap(PipelineHelper<P_OUT> ph, Supplier<Spliterator<P_IN>> supplier, boolean isParallel)

Implements abstract java.util.stream.AbstractPipeline.wrap.

Create a spliterator that wraps a source spliterator, compatible with this stream shape, and operations associated with a PipelineHelper.

Inherited from java.util.stream.AbstractPipeline:
closecopyIntocopyIntoWithCancelevaluateevaluateevaluateToArrayNodeexactOutputSizeexactOutputSizeIfKnowngetSourceShapegetStreamAndOpFlagsgetStreamFlagshasAnyStatefulisOrderedisParallelisShortCircuitingPipelinelinkOrConsumeonCloseopEvaluateParallelopEvaluateParallelLazyopIsStatefulopWrapSinkparallelsequentialsourceSpliteratorsourceStageSpliteratorspliteratorwrapAndCopyIntowrapSinkwrapSpliterator