A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/stream/LongStream.html below:

LongStream (Java SE 20 & JDK 20)

All Superinterfaces:
AutoCloseable, BaseStream<Long,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();
 

See the class documentation for

Stream

and the package documentation for

java.util.stream

for additional specification of streams, stream operations, stream pipelines, and parallelism.

Since:
1.8
See Also:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4