Streams
suggest changeVersions
The java.util.stream API has been part of Java SE since 8.
Introduction
A Stream represents a sequence of elements and supports different kinds of operations to perform computations upon those elements. With Java 8, the Collection interface has two methods to generate a Stream: stream() and parallelStream(). Stream operations are either intermediate or terminal. Intermediate operations return a Stream so multiple intermediate operations can be chained before the Stream is consumed. Terminal operations are either void or return a non-stream result.
Syntax
- collection.stream()
- Arrays.stream(array)
- Stream.iterate(firstValue, currentValue -> nextValue)
- Stream.generate(() -> value)
- Stream.of(elementOfT[, elementOfT, …])
- Stream.empty()
- StreamSupport.stream( iterable.spliterator(), false )
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents