A flow is a a functional interface for working with an ordered collection of elements. A given Flow contains only elements of a particular type. Standard operations allow for filtering the flow, or appending elements to the Flow. Since flows are immutable, all operations on flows return new immutable flows. Flows are thread safe (to the extent that the {@link Mapper} , {@link Predicate}, {@link Worker} and {@link Reducer} objects applied to the flow are).Flows are
lazy: filtering, mapping, and concatenating flows will do so with no, or a minimum, of evaluation. However, converting a Flow into a {@link List} (or other collection) willforce a realization of the entire flow.
In some cases, a flow may be an infinite, lazily evaluated sequence. Operations that iterate over all elements (such as {@link #count()} or {@link #reduce(Reducer,Object)}) may become infinite loops.
Using flows allows for a very fluid interface.
Flows are initially created using {@link F#flow(java.util.Collection)}, {@link F#flow(Object)} or{@link F#flow(Iterable)}.
@since 5.2.0
@see F#lazy(LazyFunction)