Module java.base

Interface BaseStream<T,S extends BaseStream<T,S>>

Type Parameters:
T - the type of the stream elements
S - the type of the stream implementing BaseStream
All Superinterfaces:
All Known Subinterfaces:
DoubleStream, IntStream, LongStream, Stream<T>

public interface BaseStream<T,S extends BaseStream<T,S>> extends AutoCloseable
Base interface for streams, which are sequences of elements supporting sequential and parallel aggregate operations. The following example illustrates an aggregate operation using the stream types 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, which governs the behavior of all stream types.
See Also: