APIdia Launch Partner
Top Description Methods
java.util.stream

pack-priv Interface TerminalOp<E_IN, R>

Known Direct Implementers
java.util.stream.FindOps.FindOp, java.util.stream.ForEachOps.ForEachOp, java.util.stream.MatchOps.MatchOp, java.util.stream.ReduceOps.ReduceOp
Type Parameters
<E_IN>
the type of input elements
<R>
the type of the result
Imports
java.util.Spliterator

An operation in a stream pipeline that takes a stream as input and produces a result or side-effect. A TerminalOp has an input type and stream shape, and a result type. A TerminalOp also has a set of operation flags that describes how the operation processes elements of the stream (such as short-circuiting or respecting encounter order; see StreamOpFlag).

A TerminalOp must provide a sequential and parallel implementation of the operation relative to a given stream source and set of intermediate operations.

Since
1.8

Method Summary

Modifier and TypeMethod and Description
public default <P_IN> R

Returns:

the result of the evaluation
evaluateParallel
(PipelineHelper<E_IN>
the pipeline helper
helper
,
Spliterator<P_IN>
the source spliterator
spliterator
)

Performs a parallel evaluation of the operation using the specified PipelineHelper, which describes the upstream intermediate operations.

public <P_IN> R

Returns:

the result of the evaluation
evaluateSequential
(PipelineHelper<E_IN>
the pipeline helper
helper
,
Spliterator<P_IN>
the source spliterator
spliterator
)

Performs a sequential evaluation of the operation using the specified PipelineHelper, which describes the upstream intermediate operations.

public default int

Returns:

the stream flags for this operation
getOpFlags
()

Gets the stream flags of the operation.

public default StreamShape

Returns:

StreamShape of the input type of this operation
inputShape
()

Gets the shape of the input type of this operation.

Method Detail

evaluateParallelback to summary
public default <P_IN> R evaluateParallel(PipelineHelper<E_IN> helper, Spliterator<P_IN> spliterator)

Performs a parallel evaluation of the operation using the specified PipelineHelper, which describes the upstream intermediate operations.

Implementation Specification

The default performs a sequential evaluation of the operation using the specified PipelineHelper.

Parameters
helper:PipelineHelper<E_IN>

the pipeline helper

spliterator:Spliterator<P_IN>

the source spliterator

Returns:R

the result of the evaluation

evaluateSequentialback to summary
public <P_IN> R evaluateSequential(PipelineHelper<E_IN> helper, Spliterator<P_IN> spliterator)

Performs a sequential evaluation of the operation using the specified PipelineHelper, which describes the upstream intermediate operations.

Parameters
helper:PipelineHelper<E_IN>

the pipeline helper

spliterator:Spliterator<P_IN>

the source spliterator

Returns:R

the result of the evaluation

getOpFlagsback to summary
public default int getOpFlags()

Gets the stream flags of the operation. Terminal operations may set a limited subset of the stream flags defined in StreamOpFlag, and these flags are combined with the previously combined stream and intermediate operation flags for the pipeline.

Implementation Specification

The default implementation returns zero.

Returns:int

the stream flags for this operation

See Also
StreamOpFlag
inputShapeback to summary
public default StreamShape inputShape()

Gets the shape of the input type of this operation.

Implementation Specification

The default returns StreamShape.REFERENCE.

Returns:StreamShape

StreamShape of the input type of this operation