Package 

Class Lines


  • @ApiStatus.Internal() 
    public final class Lines
    
                        

    A stream of parsed lines. Can be rewound, and sub-regions cloned for recursive descent parsing.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public int pos
    • Constructor Summary

      Constructors 
      Constructor Description
      Lines(ArrayList<out Line> list) Construct with a list of lines.
    • Method Summary

      Modifier and Type Method Description
      static Lines readLines(@NotNull() File file) Read the whole file into a Lines object.
      static Lines readLines(@NotNull() BufferedReader in) Read the whole file into a Lines object.
      boolean hasNext() If there are more lines to read within the current range.
      Line next() Return the next line, or null if there are no more lines to read.
      void rewind() Move the read position back by one line.
      • Methods inherited from class java.lang.Object

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

      • Lines

        Lines(ArrayList<out Line> list)
        Construct with a list of lines.
    • Method Detail

      • readLines

         static Lines readLines(@NotNull() File file)

        Read the whole file into a Lines object.

      • hasNext

         boolean hasNext()

        If there are more lines to read within the current range.

      • next

        @Nullable() Line next()

        Return the next line, or null if there are no more lines to read. Also returns null in theerror condition where pos is before the beginning.

      • rewind

         void rewind()

        Move the read position back by one line.