LongStream
public
interface
LongStream
implements
BaseStream<Long, LongStream>
| java.util.stream.LongStream |
A sequence of primitive long-valued elements supporting sequential and parallel
aggregate operations. This is the long primitive specialization of
Stream.
The following example illustrates an aggregate operation using
Stream and LongStream, computing the sum of the weights of the
red widgets:
long sum = widgets.stream()
.filter(w -> w.getColor() == RED)
.mapToLong(w -> w.getWeight())
.sum();
Stream and the package documentation
for java.util.stream for additional
specification of streams, stream operations, stream pipelines, and
parallelism.
See also:
Summary
Nested classes | |
|---|---|
interface |
LongStream.Builder
A mutable builder for a |
interface |
LongStream.LongMapMultiConsumer
Represents an operation that accepts a |
Public methods | |
|---|---|
abstract
boolean
|
allMatch(LongPredicate predicate)
Returns whether all elements of this stream match the provided predicate. |
abstract
boolean
|
anyMatch(LongPredicate predicate)
Returns whether any elements of this stream match the provided predicate. |
abstract
DoubleStream
|
asDoubleStream()
Returns a |
abstract
OptionalDouble
|
average()
Returns an |
abstract
Stream<Long>
|
boxed()
Returns a |
static
LongStream.Builder
|
builder()
Returns a builder for a |
abstract
<R>
R
|
collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner)
|