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

pack-priv abstract Class LongPipeline<E_IN>

extends AbstractPipeline<E_IN, Long, LongStream>
implements LongStream
Class Inheritance
All Implemented Interfaces
java.util.stream.LongStream, java.util.stream.BaseStream, java.lang.AutoCloseable
Known Direct Subclasses
java.util.stream.LongPipeline.Head, java.util.stream.LongPipeline.StatelessOp, java.util.stream.LongPipeline.StatefulOp
Type Parameters
<E_IN>
type of elements in the upstream source
Imports
java.util.LongSummaryStatistics, .Objects, .OptionalDouble, .OptionalLong, .PrimitiveIterator, .Spliterator, .Spliterators, java.util.function.BiConsumer, .BinaryOperator, .IntConsumer, .IntFunction, .LongBinaryOperator, .LongConsumer, .LongFunction, .LongPredicate, .LongToDoubleFunction, .LongToIntFunction, .LongUnaryOperator, .ObjLongConsumer, .Supplier

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
LongPipeline.Head<
type of elements in the upstream source
E_IN
>

Source stage of a LongPipeline.

pack-priv abstract static class
LongPipeline.StatefulOp<
type of elements in the upstream source
E_IN
>

Base class for a stateful intermediate stage of a LongStream.

pack-priv abstract static class
LongPipeline.StatelessOp<
type of elements in the upstream source
E_IN
>

Base class for a stateless intermediate stage of a LongStream.

Field Summary

Inherited from java.util.stream.AbstractPipeline:
previousStagesourceOrOpFlags

Constructor Summary

AccessConstructor and Description
pack-priv
LongPipeline(Supplier<? extends Spliterator<Long>>
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
LongPipeline(Spliterator<Long>
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
LongPipeline(AbstractPipeline<?, E_IN, ?>
the upstream element source.
upstream
,
int
the operation flags
opFlags
)

Constructor for appending an intermediate operation onto an existing pipeline.

Method Summary

Modifier and TypeMethod and Description
private static LongConsumer
adapt(Sink<Long> sink)

Adapt a Sink<Long> to an LongConsumer, ideally simply by casting.

private static Spliterator.OfLong
adapt(Spliterator<Long> s)

Adapt a Spliterator<Long> to a Spliterator.OfLong.

public final boolean
allMatch(LongPredicate predicate)

Implements java.util.stream.LongStream.allMatch.

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

public final boolean
anyMatch(LongPredicate predicate)

Implements java.util.stream.LongStream.anyMatch.

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

public final DoubleStream
asDoubleStream()

Implements java.util.stream.LongStream.asDoubleStream.

Returns a DoubleStream consisting of the elements of this stream, converted to double.

public final OptionalDouble
average()

Implements java.util.stream.LongStream.average.

Returns an OptionalDouble describing the arithmetic mean of elements of this stream, or an empty optional if this stream is empty.

public final Stream<Long>
boxed()

Implements java.util.stream.LongStream.boxed.

Returns a Stream consisting of the elements of this stream, each boxed to a Long.

public final <R> R
collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner)

Implements java.util.stream.LongStream.collect.

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

public final long
count()

Implements java.util.stream.LongStream.count.

Returns the count of elements in this stream.

public final LongStream
distinct()

Implements java.util.stream.LongStream.distinct.

Returns a stream consisting of the distinct elements of this stream.

public final LongStream
dropWhile(LongPredicate predicate)

Overrides default java.util.stream.LongStream.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<Long>
evaluateToNode(PipelineHelper<Long> helper, Spliterator<P_IN> spliterator, boolean flattenTree, IntFunction<Long[]> 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 LongStream
filter(LongPredicate predicate)

Implements java.util.stream.LongStream.filter.

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

public final OptionalLong
findAny()

Implements java.util.stream.LongStream.findAny.

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

public final OptionalLong
findFirst()

Implements java.util.stream.LongStream.findFirst.

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

public final LongStream
flatMap(LongFunction<? extends LongStream> mapper)

Implements java.util.stream.LongStream.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 void
forEach(LongConsumer action)

Implements java.util.stream.LongStream.forEach.

Performs an action for each element of this stream.

public void
forEachOrdered(LongConsumer action)

Implements java.util.stream.LongStream.forEachOrdered.

Performs an action for each element of this stream, guaranteeing that each element is processed in encounter order for streams that have a defined encounter order.

pack-priv final boolean
forEachWithCancel(Spliterator<Long> spliterator, Sink<Long> 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.

pack-priv final StreamShape
getOutputShape()

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

Get the output shape of the pipeline.

public final PrimitiveIterator.OfLong
iterator()

Implements java.util.stream.LongStream.iterator, java.util.stream.BaseStream.iterator.

Returns an iterator for the elements of this stream.

pack-priv final Spliterator.OfLong
lazySpliterator(Supplier<? extends Spliterator<Long>> 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 LongStream
limit(long maxSize)

Implements java.util.stream.LongStream.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<Long>
makeNodeBuilder(long exactSizeIfKnown, IntFunction<Long[]> generator)

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

Make a node builder compatible with this stream shape.

public final LongStream
map(LongUnaryOperator mapper)

Implements java.util.stream.LongStream.map.

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

public final LongStream
mapMulti(LongStream.LongMapMultiConsumer mapper)

Overrides default java.util.stream.LongStream.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
mapToDouble(LongToDoubleFunction mapper)

Implements java.util.stream.LongStream.mapToDouble.

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

public final IntStream
mapToInt(LongToIntFunction mapper)

Implements java.util.stream.LongStream.mapToInt.

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

private <U> Stream<U>
mapToObj(LongFunction<? extends U> mapper, int opFlags)

public final <U> Stream<U>
mapToObj(LongFunction<? extends U> mapper)

Implements java.util.stream.LongStream.mapToObj.

Returns an object-valued Stream consisting of the results of applying the given function to the elements of this stream.

public final OptionalLong
max()

Implements java.util.stream.LongStream.max.

Returns an OptionalLong describing the maximum element of this stream, or an empty optional if this stream is empty.

public final OptionalLong
min()

Implements java.util.stream.LongStream.min.

Returns an OptionalLong describing the minimum element of this stream, or an empty optional if this stream is empty.

public final boolean
noneMatch(LongPredicate predicate)

Implements java.util.stream.LongStream.noneMatch.

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

public final LongStream
peek(LongConsumer action)

Implements java.util.stream.LongStream.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 long
reduce(long identity, LongBinaryOperator op)

Implements java.util.stream.LongStream.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 OptionalLong
reduce(LongBinaryOperator op)

Implements java.util.stream.LongStream.reduce.

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

public final LongStream
skip(long n)

Implements java.util.stream.LongStream.skip.

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

public final LongStream
sorted()

Implements java.util.stream.LongStream.sorted.

Returns a stream consisting of the elements of this stream in sorted order.

public final Spliterator.OfLong
public final long
sum()

Implements java.util.stream.LongStream.sum.

Returns the sum of elements in this stream.

public final LongSummaryStatistics
summaryStatistics()

Implements java.util.stream.LongStream.summaryStatistics.

Returns a LongSummaryStatistics describing various summary data about the elements of this stream.

public final LongStream
takeWhile(LongPredicate predicate)

Overrides default java.util.stream.LongStream.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 long[]
toArray()

Implements java.util.stream.LongStream.toArray.

Returns an array containing the elements of this stream.

public LongStream
unordered()

Implements java.util.stream.BaseStream.unordered.

Returns an equivalent stream that is unordered.

pack-priv final <P_IN> Spliterator<Long>
wrap(PipelineHelper<Long> 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:
closecopyIntocopyIntoWithCancelevaluateevaluateevaluateToArrayNodeexactOutputSizeexactOutputSizeIfKnowngetSourceShapegetStreamAndOpFlagsgetStreamFlagshasAnyStatefulisOrderedisParallelisShortCircuitingPipelinelinkOrConsumeonCloseopEvaluateParallelopEvaluateParallelLazyopIsStatefulopWrapSinkparallelsequentialsourceSpliteratorsourceStageSpliteratorwrapAndCopyIntowrapSinkwrapSpliterator