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

pack-priv final Class ReduceOps

extends Object
Class Inheritance
Imports
java.util.Objects, .Optional, .OptionalDouble, .OptionalInt, .OptionalLong, .Spliterator, java.util.concurrent.CountedCompleter, java.util.function.BiConsumer, .BiFunction, .BinaryOperator, .DoubleBinaryOperator, .IntBinaryOperator, .LongBinaryOperator, .ObjDoubleConsumer, .ObjIntConsumer, .ObjLongConsumer, .Supplier

Factory for creating instances of TerminalOp that implement reductions.
Since
1.8

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
ReduceOps.AccumulatingSink<
the type of input element to the combining operation
T
,
the result type
R
,
the type of the AccumulatingSink.
K extends ReduceOps.AccumulatingSink<T, R, K>
>

A type of TerminalSink that implements an associative reducing operation on elements of type T and producing a result of type R.

private abstract static class
ReduceOps.Box<
The type of the state element
U
>

State box for a single state element, used as a base class for AccumulatingSink instances

pack-priv abstract static class
ReduceOps.CountingSink<T>

A sink that counts elements

private abstract static class
ReduceOps.ReduceOp<
the output type of the stream pipeline
T
,
the result type of the reducing operation
R
,
the type of the AccumulatingSink
S extends ReduceOps.AccumulatingSink<T, R, S>
>

A TerminalOp that evaluates a stream pipeline and sends the output into an AccumulatingSink, which performs a reduce operation.

private static class
ReduceOps.ReduceTask<P_IN, P_OUT, R, S extends ReduceOps.AccumulatingSink<P_OUT, R, S>>

A ForkJoinTask for performing a parallel reduce operation.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TerminalOp<Double, Double>

Returns:

a TerminalOp implementing the reduction
makeDouble
(double
the identity for the combining function
identity
,
DoubleBinaryOperator
the combining function
operator
)

Constructs a TerminalOp that implements a functional reduce on double values.

public static TerminalOp<Double, OptionalDouble>

Returns:

a TerminalOp implementing the reduction
makeDouble
(DoubleBinaryOperator
the combining function
operator
)

Constructs a TerminalOp that implements a functional reduce on double values, producing an optional double result.

public static <
the type of the result
R
>
TerminalOp<Double, R>

Returns:

a TerminalOp implementing the reduction
makeDouble
(Supplier<R>
a factory to produce a new accumulator of the result type
supplier
,
ObjDoubleConsumer<R>
a function to incorporate an int into an accumulator
accumulator
,
BinaryOperator<R>
a function to combine an accumulator into another
combiner
)

Constructs a TerminalOp that implements a mutable reduce on double values.

public static TerminalOp<Double, Long>

Returns:

a TerminalOp implementing the counting
makeDoubleCounting
()

Constructs a TerminalOp that counts the number of stream elements.

public static TerminalOp<Integer, Integer>

Returns:

a TerminalOp implementing the reduction
makeInt
(int
the identity for the combining function
identity
,
IntBinaryOperator
the combining function
operator
)

Constructs a TerminalOp that implements a functional reduce on int values.

public static TerminalOp<Integer, OptionalInt>

Returns:

a TerminalOp implementing the reduction
makeInt
(IntBinaryOperator
the combining function
operator
)

Constructs a TerminalOp that implements a functional reduce on int values, producing an optional integer result.

public static <
The type of the result
R
>
TerminalOp<Integer, R>

Returns:

A ReduceOp implementing the reduction
makeInt
(Supplier<R>
a factory to produce a new accumulator of the result type
supplier
,
ObjIntConsumer<R>
a function to incorporate an int into an accumulator
accumulator
,
BinaryOperator<R>
a function to combine an accumulator into another
combiner
)

Constructs a TerminalOp that implements a mutable reduce on int values.

public static TerminalOp<Integer, Long>

Returns:

a TerminalOp implementing the counting
makeIntCounting
()

Constructs a TerminalOp that counts the number of stream elements.

public static TerminalOp<Long, Long>

Returns:

a TerminalOp implementing the reduction
makeLong
(long
the identity for the combining function
identity
,
LongBinaryOperator
the combining function
operator
)

Constructs a TerminalOp that implements a functional reduce on long values.

public static TerminalOp<Long, OptionalLong>

Returns:

a TerminalOp implementing the reduction
makeLong
(LongBinaryOperator
the combining function
operator
)

Constructs a TerminalOp that implements a functional reduce on long values, producing an optional long result.

public static <
the type of the result
R
>
TerminalOp<Long, R>

Returns:

a TerminalOp implementing the reduction
makeLong
(Supplier<R>
a factory to produce a new accumulator of the result type
supplier
,
ObjLongConsumer<R>
a function to incorporate an int into an accumulator
accumulator
,
BinaryOperator<R>
a function to combine an accumulator into another
combiner
)

Constructs a TerminalOp that implements a mutable reduce on long values.

public static TerminalOp<Long, Long>

Returns:

a TerminalOp implementing the counting
makeLongCounting
()

Constructs a TerminalOp that counts the number of stream elements.

public static <
the type of the input elements
T
,
the type of the result
U
>
TerminalOp<T, U>

Returns:

a TerminalOp implementing the reduction
makeRef
(U
the identity element for the reduction
seed
,
BiFunction<U, ? super T, U>
the accumulating function that incorporates an additional input element into the result
reducer
,
BinaryOperator<U>
the combining function that combines two intermediate results
combiner
)

Constructs a TerminalOp that implements a functional reduce on reference values.

public static <
The type of the input elements, and the type of the result
T
>
TerminalOp<T, Optional<T>>

Returns:

A TerminalOp implementing the reduction
makeRef
(BinaryOperator<T>
The reducing function
operator
)

Constructs a TerminalOp that implements a functional reduce on reference values producing an optional reference result.

public static <
the type of the input elements
T
,
the type of the intermediate reduction result
I
>
TerminalOp<T, I>

Returns:

a ReduceOp implementing the reduction
makeRef
(Collector<? super T, I, ?>
a Collector defining the reduction
collector
)

Constructs a TerminalOp that implements a mutable reduce on reference values.

public static <
the type of the input elements
T
,
the type of the result
R
>
TerminalOp<T, R>

Returns:

a TerminalOp implementing the reduction
makeRef
(Supplier<R>
a factory to produce a new base accumulator
seedFactory
,
BiConsumer<R, ? super T>
a function to incorporate an element into an accumulator
accumulator
,
BiConsumer<R, R>
a function to combine an accumulator into another
reducer
)

Constructs a TerminalOp that implements a mutable reduce on reference values.

public static <
the type of the input elements
T
>
TerminalOp<T, Long>

Returns:

a TerminalOp implementing the counting
makeRefCounting
()

Constructs a TerminalOp that counts the number of stream elements.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ReduceOpsback to summary
private ReduceOps()

Method Detail

makeDoubleback to summary
public static TerminalOp<Double, Double> makeDouble(double identity, DoubleBinaryOperator operator)

Constructs a TerminalOp that implements a functional reduce on double values.

Parameters
identity:double

the identity for the combining function

operator:DoubleBinaryOperator

the combining function

Returns:TerminalOp<Double, Double>

a TerminalOp implementing the reduction

makeDoubleback to summary
public static TerminalOp<Double, OptionalDouble> makeDouble(DoubleBinaryOperator operator)

Constructs a TerminalOp that implements a functional reduce on double values, producing an optional double result.

Parameters
operator:DoubleBinaryOperator

the combining function

Returns:TerminalOp<Double, OptionalDouble>

a TerminalOp implementing the reduction

makeDoubleback to summary
public static <R> TerminalOp<Double, R> makeDouble(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BinaryOperator<R> combiner)

Constructs a TerminalOp that implements a mutable reduce on double values.

Parameters
<R>
the type of the result
supplier:Supplier<R>

a factory to produce a new accumulator of the result type

accumulator:ObjDoubleConsumer<R>

a function to incorporate an int into an accumulator

combiner:BinaryOperator<R>

a function to combine an accumulator into another

Returns:TerminalOp<Double, R>

a TerminalOp implementing the reduction

makeDoubleCountingback to summary
public static TerminalOp<Double, Long> makeDoubleCounting()

Constructs a TerminalOp that counts the number of stream elements. If the size of the pipeline is known then count is the size and there is no need to evaluate the pipeline. If the size of the pipeline is non known then count is produced, via reduction, using a CountingSink.

Returns:TerminalOp<Double, Long>

a TerminalOp implementing the counting

makeIntback to summary
public static TerminalOp<Integer, Integer> makeInt(int identity, IntBinaryOperator operator)

Constructs a TerminalOp that implements a functional reduce on int values.

Parameters
identity:int

the identity for the combining function

operator:IntBinaryOperator

the combining function

Returns:TerminalOp<Integer, Integer>

a TerminalOp implementing the reduction

makeIntback to summary
public static TerminalOp<Integer, OptionalInt> makeInt(IntBinaryOperator operator)

Constructs a TerminalOp that implements a functional reduce on int values, producing an optional integer result.

Parameters
operator:IntBinaryOperator

the combining function

Returns:TerminalOp<Integer, OptionalInt>

a TerminalOp implementing the reduction

makeIntback to summary
public static <R> TerminalOp<Integer, R> makeInt(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BinaryOperator<R> combiner)

Constructs a TerminalOp that implements a mutable reduce on int values.

Parameters
<R>
The type of the result
supplier:Supplier<R>

a factory to produce a new accumulator of the result type

accumulator:ObjIntConsumer<R>

a function to incorporate an int into an accumulator

combiner:BinaryOperator<R>

a function to combine an accumulator into another

Returns:TerminalOp<Integer, R>

A ReduceOp implementing the reduction

makeIntCountingback to summary
public static TerminalOp<Integer, Long> makeIntCounting()

Constructs a TerminalOp that counts the number of stream elements. If the size of the pipeline is known then count is the size and there is no need to evaluate the pipeline. If the size of the pipeline is non known then count is produced, via reduction, using a CountingSink.

Returns:TerminalOp<Integer, Long>

a TerminalOp implementing the counting

makeLongback to summary
public static TerminalOp<Long, Long> makeLong(long identity, LongBinaryOperator operator)

Constructs a TerminalOp that implements a functional reduce on long values.

Parameters
identity:long

the identity for the combining function

operator:LongBinaryOperator

the combining function

Returns:TerminalOp<Long, Long>

a TerminalOp implementing the reduction

makeLongback to summary
public static TerminalOp<Long, OptionalLong> makeLong(LongBinaryOperator operator)

Constructs a TerminalOp that implements a functional reduce on long values, producing an optional long result.

Parameters
operator:LongBinaryOperator

the combining function

Returns:TerminalOp<Long, OptionalLong>

a TerminalOp implementing the reduction

makeLongback to summary
public static <R> TerminalOp<Long, R> makeLong(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BinaryOperator<R> combiner)

Constructs a TerminalOp that implements a mutable reduce on long values.

Parameters
<R>
the type of the result
supplier:Supplier<R>

a factory to produce a new accumulator of the result type

accumulator:ObjLongConsumer<R>

a function to incorporate an int into an accumulator

combiner:BinaryOperator<R>

a function to combine an accumulator into another

Returns:TerminalOp<Long, R>

a TerminalOp implementing the reduction

makeLongCountingback to summary
public static TerminalOp<Long, Long> makeLongCounting()

Constructs a TerminalOp that counts the number of stream elements. If the size of the pipeline is known then count is the size and there is no need to evaluate the pipeline. If the size of the pipeline is non known then count is produced, via reduction, using a CountingSink.

Returns:TerminalOp<Long, Long>

a TerminalOp implementing the counting

makeRefback to summary
public static <T, U> TerminalOp<T, U> makeRef(U seed, BiFunction<U, ? super T, U> reducer, BinaryOperator<U> combiner)

Constructs a TerminalOp that implements a functional reduce on reference values.

Parameters
<T>
the type of the input elements
<U>
the type of the result
seed:U

the identity element for the reduction

reducer:BiFunction<U, ? super T, U>

the accumulating function that incorporates an additional input element into the result

combiner:BinaryOperator<U>

the combining function that combines two intermediate results

Returns:TerminalOp<T, U>

a TerminalOp implementing the reduction

makeRefback to summary
public static <T> TerminalOp<T, Optional<T>> makeRef(BinaryOperator<T> operator)

Constructs a TerminalOp that implements a functional reduce on reference values producing an optional reference result.

Parameters
<T>
The type of the input elements, and the type of the result
operator:BinaryOperator<T>

The reducing function

Returns:TerminalOp<T, Optional<T>>

A TerminalOp implementing the reduction

makeRefback to summary
public static <T, I> TerminalOp<T, I> makeRef(Collector<? super T, I, ?> collector)

Constructs a TerminalOp that implements a mutable reduce on reference values.

Parameters
<T>
the type of the input elements
<I>
the type of the intermediate reduction result
collector:Collector<? super T, I, ?>

a Collector defining the reduction

Returns:TerminalOp<T, I>

a ReduceOp implementing the reduction

makeRefback to summary
public static <T, R> TerminalOp<T, R> makeRef(Supplier<R> seedFactory, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> reducer)

Constructs a TerminalOp that implements a mutable reduce on reference values.

Parameters
<T>
the type of the input elements
<R>
the type of the result
seedFactory:Supplier<R>

a factory to produce a new base accumulator

accumulator:BiConsumer<R, ? super T>

a function to incorporate an element into an accumulator

reducer:BiConsumer<R, R>

a function to combine an accumulator into another

Returns:TerminalOp<T, R>

a TerminalOp implementing the reduction

makeRefCountingback to summary
public static <T> TerminalOp<T, Long> makeRefCounting()

Constructs a TerminalOp that counts the number of stream elements. If the size of the pipeline is known then count is the size and there is no need to evaluate the pipeline. If the size of the pipeline is non known then count is produced, via reduction, using a CountingSink.

Parameters
<T>
the type of the input elements
Returns:TerminalOp<T, Long>

a TerminalOp implementing the counting

java.util.stream back to summary

private Interface ReduceOps.AccumulatingSink<T, R, K extends ReduceOps.AccumulatingSink<T, R, K>>

extends TerminalSink<T, R>
Known Direct Implementers
java.util.stream.ReduceOps.CountingSink
Type Parameters
<T>
the type of input element to the combining operation
<R>
the result type
<K>
the type of the AccumulatingSink.

A type of TerminalSink that implements an associative reducing operation on elements of type T and producing a result of type R.

Method Summary

Modifier and TypeMethod and Description
public void
combine(K other)

Method Detail

combineback to summary
public void combine(K other)
java.util.stream back to summary

private abstract Class ReduceOps.Box<U>

extends Object
Class Inheritance
Known Direct Subclasses
java.util.stream.ReduceOps.CountingSink
Type Parameters
<U>
The type of the state element

State box for a single state element, used as a base class for AccumulatingSink instances

Field Summary

Modifier and TypeField and Description
pack-priv U

Constructor Summary

AccessConstructor and Description
pack-priv
Box()

Method Summary

Modifier and TypeMethod and Description
public U
get()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

stateback to summary
pack-priv U state

Constructor Detail

Boxback to summary
pack-priv Box()

Method Detail

getback to summary
public U get()
java.util.stream back to summary

pack-priv abstract Class ReduceOps.CountingSink<T>

extends ReduceOps.Box<Long>
implements ReduceOps.AccumulatingSink<T, Long, ReduceOps.CountingSink<T>>
Class Inheritance
All Implemented Interfaces
java.util.stream.ReduceOps.AccumulatingSink, java.util.stream.TerminalSink, java.util.function.Supplier, java.util.stream.Sink, java.util.function.Consumer
Known Direct Subclasses
java.util.stream.ReduceOps.CountingSink.OfRef, java.util.stream.ReduceOps.CountingSink.OfInt, java.util.stream.ReduceOps.CountingSink.OfLong, java.util.stream.ReduceOps.CountingSink.OfDouble

A sink that counts elements

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv long
Inherited from java.util.stream.ReduceOps.Box:
state

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
begin(long size)

Overrides default java.util.stream.Sink.begin.

Resets the sink state to receive a fresh data set.

public void
public Long

Field Detail

countback to summary
pack-priv long count

Constructor Detail

CountingSinkback to summary
pack-priv CountingSink()

Method Detail

beginback to summary
public void begin(long size)

Overrides default java.util.stream.Sink.begin.

Doc from java.util.stream.Sink.begin.

Resets the sink state to receive a fresh data set. This must be called before sending any data to the sink. After calling end(), you may call this method to reset the sink for another calculation.

Annotations
@Override
combineback to summary
public void combine(ReduceOps.CountingSink<T> other)

Implements java.util.stream.ReduceOps.AccumulatingSink.combine.

Annotations
@Override
getback to summary
public Long get()

Overrides java.util.stream.ReduceOps.Box.get.

Implements java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Annotations
@Override
java.util.stream back to summary

pack-priv final Class ReduceOps.CountingSink.OfDouble

extends ReduceOps.CountingSink<Double>
implements OfDouble
Class Inheritance
All Implemented Interfaces
java.util.stream.Sink.OfDouble, java.util.function.DoubleConsumer, java.util.stream.Sink, java.util.function.Consumer

Field Summary

Inherited from java.util.stream.ReduceOps.CountingSink:
count

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(double t)

Overrides default java.util.stream.Sink.accept.

Implements java.util.stream.Sink.OfDouble.accept.

Accepts a double value.

Inherited from java.util.stream.ReduceOps.CountingSink:
begincombineget

Constructor Detail

OfDoubleback to summary
pack-priv OfDouble()

Method Detail

acceptback to summary
public void accept(double t)

Overrides default java.util.stream.Sink.accept.

Implements java.util.stream.Sink.OfDouble.accept.

Doc from java.util.stream.Sink.accept.

Accepts a double value.

Annotations
@Override
java.util.stream back to summary

pack-priv final Class ReduceOps.CountingSink.OfInt

extends ReduceOps.CountingSink<Integer>
implements OfInt
Class Inheritance
All Implemented Interfaces
java.util.stream.Sink.OfInt, java.util.function.IntConsumer, java.util.stream.Sink, java.util.function.Consumer

Field Summary

Inherited from java.util.stream.ReduceOps.CountingSink:
count

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(int t)

Overrides default java.util.stream.Sink.accept.

Implements java.util.stream.Sink.OfInt.accept.

Accepts an int value.

Inherited from java.util.stream.ReduceOps.CountingSink:
begincombineget

Constructor Detail

OfIntback to summary
pack-priv OfInt()

Method Detail

acceptback to summary
public void accept(int t)

Overrides default java.util.stream.Sink.accept.

Implements java.util.stream.Sink.OfInt.accept.

Doc from java.util.stream.Sink.accept.

Accepts an int value.

Annotations
@Override
java.util.stream back to summary

pack-priv final Class ReduceOps.CountingSink.OfLong

extends ReduceOps.CountingSink<Long>
implements OfLong
Class Inheritance
All Implemented Interfaces
java.util.stream.Sink.OfLong, java.util.function.LongConsumer, java.util.stream.Sink, java.util.function.Consumer

Field Summary

Inherited from java.util.stream.ReduceOps.CountingSink:
count

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(long t)

Overrides default java.util.stream.Sink.accept.

Implements java.util.stream.Sink.OfLong.accept.

Accepts a long value.

Inherited from java.util.stream.ReduceOps.CountingSink:
begincombineget

Constructor Detail

OfLongback to summary
pack-priv OfLong()

Method Detail

acceptback to summary
public void accept(long t)

Overrides default java.util.stream.Sink.accept.

Implements java.util.stream.Sink.OfLong.accept.

Doc from java.util.stream.Sink.accept.

Accepts a long value.

Annotations
@Override
java.util.stream back to summary

pack-priv final Class ReduceOps.CountingSink.OfRef<T>

extends ReduceOps.CountingSink<T>
Class Inheritance

Field Summary

Inherited from java.util.stream.ReduceOps.CountingSink:
count

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(T t)

Implements java.util.function.Consumer.accept.

Performs this operation on the given argument.

Inherited from java.util.stream.ReduceOps.CountingSink:
begincombineget

Constructor Detail

OfRefback to summary
pack-priv OfRef()

Method Detail

acceptback to summary
public void accept(T t)

Implements java.util.function.Consumer.accept.

Doc from java.util.function.Consumer.accept.

Performs this operation on the given argument.

Annotations
@Override
java.util.stream back to summary

private abstract Class ReduceOps.ReduceOp<T, R, S extends ReduceOps.AccumulatingSink<T, R, S>>

extends Object
implements TerminalOp<T, R>
Class Inheritance
All Implemented Interfaces
java.util.stream.TerminalOp
Type Parameters
<T>
the output type of the stream pipeline
<R>
the result type of the reducing operation
<S>
the type of the AccumulatingSink

A TerminalOp that evaluates a stream pipeline and sends the output into an AccumulatingSink, which performs a reduce operation. The AccumulatingSink must represent an associative reducing operation.

Field Summary

Modifier and TypeField and Description
private final StreamShape

Constructor Summary

AccessConstructor and Description
pack-priv
ReduceOp(StreamShape
The shape of the stream pipeline
shape
)

Create a ReduceOp of the specified stream shape which uses the specified Supplier to create accumulating sinks.

Method Summary

Modifier and TypeMethod and Description
public <P_IN> R
evaluateParallel(PipelineHelper<T> helper, Spliterator<P_IN> spliterator)

Overrides default java.util.stream.TerminalOp.evaluateParallel.

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

public <P_IN> R
evaluateSequential(PipelineHelper<T> helper, Spliterator<P_IN> spliterator)

Implements java.util.stream.TerminalOp.evaluateSequential.

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

public StreamShape
inputShape()

Overrides default java.util.stream.TerminalOp.inputShape.

Gets the shape of the input type of this operation.

public abstract S
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inputShapeback to summary
private final StreamShape inputShape

Constructor Detail

ReduceOpback to summary
pack-priv ReduceOp(StreamShape shape)

Create a ReduceOp of the specified stream shape which uses the specified Supplier to create accumulating sinks.

Parameters
shape:StreamShape

The shape of the stream pipeline

Method Detail

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

Overrides default java.util.stream.TerminalOp.evaluateParallel.

Doc from java.util.stream.TerminalOp.evaluateParallel.

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

Annotations
@Override
evaluateSequentialback to summary
public <P_IN> R evaluateSequential(PipelineHelper<T> helper, Spliterator<P_IN> spliterator)

Implements java.util.stream.TerminalOp.evaluateSequential.

Doc from java.util.stream.TerminalOp.evaluateSequential.

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

Annotations
@Override
inputShapeback to summary
public StreamShape inputShape()

Overrides default java.util.stream.TerminalOp.inputShape.

Doc from java.util.stream.TerminalOp.inputShape.

Gets the shape of the input type of this operation.

Annotations
@Override
makeSinkback to summary
public abstract S makeSink()
java.util.stream back to summary

private final Class ReduceOps.ReduceTask<P_IN, P_OUT, R, S extends ReduceOps.AccumulatingSink<P_OUT, R, S>>

extends AbstractTask<P_IN, P_OUT, S extends ReduceOps.AccumulatingSink<P_OUT, R, S>, ReduceOps.ReduceTask<P_IN, P_OUT, R, S extends ReduceOps.AccumulatingSink<P_OUT, R, S>>>
Class Inheritance
Annotations
@SuppressWarnings:serial

A ForkJoinTask for performing a parallel reduce operation.

Field Summary

Modifier and TypeField and Description
private final ReduceOps.ReduceOp<P_OUT, R, S>
Inherited from java.util.stream.AbstractTask:
helperleftChildrightChildspliteratortargetSize

Constructor Summary

AccessConstructor and Description
pack-priv
ReduceTask(ReduceOps.ReduceOp<P_OUT, R, S> op, PipelineHelper<P_OUT> helper, Spliterator<P_IN> spliterator)

pack-priv
ReduceTask(ReduceOps.ReduceTask<P_IN, P_OUT, R, S> parent, Spliterator<P_IN> spliterator)

Method Summary

Modifier and TypeMethod and Description
protected S
doLeaf()

Implements abstract java.util.stream.AbstractTask.doLeaf.

Computes the result associated with a leaf node.

protected ReduceOps.ReduceTask<P_IN, P_OUT, R, S>
makeChild(Spliterator<P_IN> spliterator)

Implements abstract java.util.stream.AbstractTask.makeChild.

Constructs a new node of type T whose parent is the receiver; must call the AbstractTask(T, Spliterator) constructor with the receiver and the provided Spliterator.

public void
onCompletion(CountedCompleter<?> caller)

Overrides java.util.stream.AbstractTask.onCompletion.

Performs an action when method tryComplete is invoked and the pending count is zero, or when the unconditional method complete is invoked.

Inherited from java.util.stream.AbstractTask:
computegetLeafTargetgetLocalResultgetParentgetRawResultgetTargetSizeisLeafisLeftmostNodeisRootsetLocalResultsetRawResultsuggestTargetSize

Field Detail

opback to summary
private final ReduceOps.ReduceOp<P_OUT, R, S> op

Constructor Detail

ReduceTaskback to summary
pack-priv ReduceTask(ReduceOps.ReduceOp<P_OUT, R, S> op, PipelineHelper<P_OUT> helper, Spliterator<P_IN> spliterator)
ReduceTaskback to summary
pack-priv ReduceTask(ReduceOps.ReduceTask<P_IN, P_OUT, R, S> parent, Spliterator<P_IN> spliterator)

Method Detail

doLeafback to summary
protected S doLeaf()

Implements abstract java.util.stream.AbstractTask.doLeaf.

Doc from java.util.stream.AbstractTask.doLeaf.

Computes the result associated with a leaf node. Will be called by compute() and the result passed to setLocalResult()

Annotations
@Override
makeChildback to summary
protected ReduceOps.ReduceTask<P_IN, P_OUT, R, S> makeChild(Spliterator<P_IN> spliterator)

Implements abstract java.util.stream.AbstractTask.makeChild.

Doc from java.util.stream.AbstractTask.makeChild.

Constructs a new node of type T whose parent is the receiver; must call the AbstractTask(T, Spliterator) constructor with the receiver and the provided Spliterator.

Annotations
@Override
onCompletionback to summary
public void onCompletion(CountedCompleter<?> caller)

Overrides java.util.stream.AbstractTask.onCompletion.

Doc from java.util.stream.AbstractTask.onCompletion.

Performs an action when method tryComplete is invoked and the pending count is zero, or when the unconditional method complete is invoked. By default, this method does nothing. You can distinguish cases by checking the identity of the given caller argument. If not equal to this, then it is typically a subtask that may contain results (and/or links to other results) to combine.

Annotations
@Override