Module java.base

Interface IntStream

All Superinterfaces:
AutoCloseable, BaseStream<Integer,IntStream>

public interface IntStream extends BaseStream<Integer,IntStream>
A sequence of primitive int-valued elements supporting sequential and parallel aggregate operations. This is the int primitive specialization of Stream.

The following example illustrates an aggregate operation using Stream and IntStream, computing the sum of the weights of the red widgets:

     int sum =
                      .filter(w -> w.getColor() == RED)
                      .mapToInt(w -> w.getWeight())
See the class documentation for Stream and the package documentation for for additional specification of streams, stream operations, stream pipelines, and parallelism.

See Also: