Class ImmutableDataStream<V>

java.lang.Object
org.moeaframework.analysis.stream.ImmutableDataStream<V>
Type Parameters:
V - the type of each value in the data stream
All Implemented Interfaces:
Iterable<V>, DataStream<V>, Displayable, Formattable<V>

public class ImmutableDataStream<V> extends Object implements DataStream<V>
A data stream storing the intermediate, materialized content of the stream.
  • Constructor Details

    • ImmutableDataStream

      public ImmutableDataStream()
      Constructs a new, empty data stream.
    • ImmutableDataStream

      public ImmutableDataStream(List<V> list)
      Constructs a new data stream with the given content.
      Parameters:
      list - the list of values
    • ImmutableDataStream

      public ImmutableDataStream(Stream<V> stream)
      Constructs a new data stream with the given content.
      Parameters:
      stream - the stream of values
    • ImmutableDataStream

      public ImmutableDataStream(Iterable<V> iterable)
      Constructs a new data stream with the given content.
      Parameters:
      iterable - the iterable of values
  • Method Details

    • size

      public int size()
      Description copied from interface: DataStream
      Returns the number of values in this data stream.
      Specified by:
      size in interface DataStream<V>
      Returns:
      the number of values
    • stream

      public Stream<V> stream()
      Description copied from interface: DataStream
      Returns a Stream of the values in this data stream.
      Specified by:
      stream in interface DataStream<V>
      Returns:
      the stream
    • iterator

      public Iterator<V> iterator()
      Specified by:
      iterator in interface Iterable<V>