Class SMFTLineReaderList

  • All Implemented Interfaces:
    SMFTLineReaderType

    public final class SMFTLineReaderList
    extends java.lang.Object
    A line reader based on a list of strings.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SMFTLineReaderType create​(java.net.URI in_uri, java.util.List<java.lang.String> in_lines, int in_start)
      Construct a new line reader.
      java.util.Optional<java.util.List<java.lang.String>> line()
      Get the next line.
      protected java.lang.String lineNextRaw()  
      protected org.slf4j.Logger log()  
      com.io7m.jlexing.core.LexicalPosition<java.net.URI> position()  
      • Methods inherited from class java.lang.Object

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

      • create

        public static SMFTLineReaderType create​(java.net.URI in_uri,
                                                java.util.List<java.lang.String> in_lines,
                                                int in_start)
        Construct a new line reader.
        Parameters:
        in_uri - The file path, for diagnostic messages
        in_lines - The stream of lines
        in_start - The number of the starting line, for diagnostic messages
        Returns:
        A line reader
      • log

        protected org.slf4j.Logger log()
      • lineNextRaw

        protected java.lang.String lineNextRaw()
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • position

        public final com.io7m.jlexing.core.LexicalPosition<java.net.URI> position()
        Specified by:
        position in interface SMFTLineReaderType
        Returns:
        The current position
      • line

        public final java.util.Optional<java.util.List<java.lang.String>> line()
                                                                        throws java.io.IOException
        Description copied from interface: SMFTLineReaderType
        Get the next line.
        Specified by:
        line in interface SMFTLineReaderType
        Returns:
        A lexed line, or nothing on EOF
        Throws:
        java.io.IOException - On I/O errors