Stream

Interface Stream<T>

Type Parameters:
T - the type of the stream elements
All Superinterfaces:
AutoCloseable, BaseStream<T,Stream<T>>
public interface Stream<T>
extends BaseStream<T,Stream<T>>

A sequence of elements supporting sequential and parallel aggregate operations. The following example illustrates an aggregate operation using Stream and IntStream:

int sum = widgets.stream()
                      .filter(w -> w.getColor() == RED)
                      .mapToInt(w -> w.getWeight())
                      .sum();
In