Class StreamScanner<T>

  • Type Parameters:
    T - the types of the stream items.

    public final class StreamScanner<T>
    extends Scanner<T>
    A scanner iterating over items of a stream. Nothing really fancy.
    • Method Detail

      • scan

        public static <X> Scanner<X> scan​(Stream<X> stream)
        Create a scanner iterating over a stream.
        Type Parameters:
        X - the type of stream items.
        Parameters:
        stream - the stream to scan.
        Returns:
        the scanner
      • create

        protected <X> Scanner<X> create​(Stream<X> source)
        Description copied from class: Scanner
        Constructs a scanner out of a source stream.
        Specified by:
        create in class Scanner<T>
        Type Parameters:
        X - the type of elements in the source stream.
        Parameters:
        source - the wrapped stream, will contain only one element when it is a root.
        Returns:
        a scanner based on the given source.