Class ByLineReaderSource

  • All Implemented Interfaces:
    ByLineSource

    public class ByLineReaderSource
    extends java.lang.Object
    implements ByLineSource
    ByLineSource default implementation
    Version:
    $Id: ByLineReaderSource.java 1726913 2016-01-26 22:01:54Z rfscholte $
    • Constructor Summary

      Constructors 
      Constructor Description
      ByLineReaderSource​(java.io.Reader in)
      Creates the ByLineReaderSource.
      ByLineReaderSource​(java.io.Reader in, java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      close the source.
      int getLineNumber()
      getLineNumber.
      java.lang.String getName()
      getName.
      java.lang.String getNextLine()
      getNextLine.
      void unget​(java.lang.String s)
      unget.
      void ungetLine()
      ungetLine.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByLineReaderSource

        public ByLineReaderSource​(java.io.Reader in)
        Creates the ByLineReaderSource.
        Parameters:
        in - real source :)
      • ByLineReaderSource

        public ByLineReaderSource​(java.io.Reader in,
                                  java.lang.String name)
    • Method Detail

      • getName

        public final java.lang.String getName()

        getName.

        Specified by:
        getName in interface ByLineSource
        Returns:
        the name of the input. could be the filename for example.
      • getLineNumber

        public final int getLineNumber()

        getLineNumber.

        Specified by:
        getLineNumber in interface ByLineSource
        Returns:
        the current line number.
      • close

        public final void close()
        close the source.
        Specified by:
        close in interface ByLineSource
      • ungetLine

        public final void ungetLine()

        ungetLine.

        This should throw a java.lang.IllegalStateException if called more than one time without calling getNextLine().
        Specified by:
        ungetLine in interface ByLineSource
      • unget

        public final void unget​(java.lang.String s)

        unget.

        Specified by:
        unget in interface ByLineSource
        Parameters:
        s - some text to push back to the parser. This should throw a java.lang.IllegalStateException if called more than one time without calling getNextLine().