Interface LineReader

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BufferedLineReader, StringLineReader

public interface LineReader extends Closeable
Interface allows for implementations that read lines from a String, an ASCII file, or somewhere else.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    int
     
    int
    Non-destructive one-character look-ahead.
    Read a line and remove the line terminator
  • Field Details

  • Method Details

    • readLine

      String readLine()
      Read a line and remove the line terminator
      Returns:
      the line read, or null if EOF has been reached.
    • getLineNumber

      int getLineNumber()
      Returns:
      1-based number of line most recently read
    • peek

      int peek()
      Non-destructive one-character look-ahead.
      Returns:
      If not eof, the next character that would be read. If eof, -1.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable