Package org.moeaframework.analysis.stream


package org.moeaframework.analysis.stream
Streaming API for manipulating and analyzing data.

This package provides several data structures for streams, including:

  1. DataStream - A stream of values,
  2. Partition - A stream of key-value pairs, and
  3. Groups - A stream of keys mapped to a collection of values.
Additionally, this provides static methods for creating Groupings and aggregating data using Measures. While these methods are intended to be used with the data structures, they may also be used directly on the underlying stream.

This API is inspired by Java's Stream API, and uses it under the covers, with a few modifications:

  • Unlike Java streams, multiple operations are permitted on the same data stream. This is allowed since intermediate results are materialized after each operation, at the cost of performance.
  • The original data source can be modified after constructing a data stream, again because intermediate results are materialized.
  • Parallel streams are not supported, since this library is not designed to be thread-safe.