Package jminusminus

Class CharReader

java.lang.Object
jminusminus.CharReader

class CharReader extends Object
A buffered character reader, which abstracts out differences between platforms, mapping all new lines to '\n', and also keeps track of line numbers.
  • Field Details

  • Constructor Details

  • Method Details

    • nextChar

      public char nextChar() throws IOException
      Scans and returns the next character.
      Returns:
      the character scanned.
      Throws:
      IOException - if an I/O error occurs.
    • line

      public int line()
      Returns the current line number in the source file.
      Returns:
      the current line number in the source file.
    • fileName

      public String fileName()
      Returns the file name.
      Returns:
      the file name.
    • close

      public void close() throws IOException
      Closes the file.
      Throws:
      IOException - if an I/O error occurs.