Class SimpleStreamer<T>

  • All Implemented Interfaces:
    Streamer<T>, Iterator<T>

    public class SimpleStreamer<T>
    extends Object
    implements Streamer<T>
    Simple implementation of a Streamer.
    Since:
    12.2.1
    Author:
    as 2015.05.07
    • Constructor Detail

      • SimpleStreamer

        public SimpleStreamer​(Iterable<T> iterable)
        Construct Streamer based on Iterable.
        Parameters:
        iterable - an Iterable to create Streamer from
      • SimpleStreamer

        public SimpleStreamer​(Iterator<T> iterator)
        Construct Streamer based on Iterator.
        Parameters:
        iterator - an Iterator to create Streamer from
      • SimpleStreamer

        public SimpleStreamer​(Stream<T> stream)
        Construct Streamer based on Stream.
        Parameters:
        stream - a Stream to create Streamer from
      • SimpleStreamer

        public SimpleStreamer​(Collection<T> coll)
        Construct Streamer based on Collection.
        Parameters:
        coll - a Collection to create Streamer from
      • SimpleStreamer

        protected SimpleStreamer​(Iterator<T> iterator,
                                 long cSize,
                                 int nCharacteristics)
        Construct Streamer instance.
        Parameters:
        iterator - an Iterator to create Streamer from
        cSize - the number of elements this Streamer will iterate over
        nCharacteristics - the bit mask representing this Streamer's characteristics
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface Iterator<T>
      • size

        public long size()
        Description copied from interface: Streamer
        Return the exact size of the data set this Streamer will iterate over, or negative integer if the exact size is unknown.
        Specified by:
        size in interface Streamer<T>
        Returns:
        the exact size of the data set this Streamer will iterate over, or negative integer if the exact size is unknown
      • characteristics

        public int characteristics()
        Description copied from interface: Streamer
        A bit mask representing the set of characteristics of this Streamer.
        Specified by:
        characteristics in interface Streamer<T>
        Returns:
        a bit mask representing the set of characteristics of this Streamer