Class Scanner


  • public class Scanner
    extends java.lang.Object
    A simple class for tokenizing lines of an input file. Lines of the form
    number;key are parsed as two tokens,
    "string";key are parsed as two tokens,
    BLOCK are parsed as a block,
    BLOCK id are parsed as a block with ID.
    Version:
    $Revision: 389 $
    Author:
    $Author: $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int argc
      number of tokens
      java.lang.String[] argv
      the tokens
      boolean eof
      end of file reached?
      boolean isBlock
      Is this a begin of block token?
      boolean isIdBlock
      Is this a block with Id?
      boolean[] isString
      Is it a string?
      int lnr
      current line number
    • Constructor Summary

      Constructors 
      Constructor Description
      Scanner​(java.io.Reader in)
      Creates a new Scanner object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void getNextToken()
      Parses until the next token, skipping empty lines.
      • Methods inherited from class java.lang.Object

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

      • argc

        public int argc
        number of tokens
      • argv

        public java.lang.String[] argv
        the tokens
      • isString

        public boolean[] isString
        Is it a string? (enclosed in "")
      • eof

        public boolean eof
        end of file reached?
      • lnr

        public int lnr
        current line number
      • isBlock

        public boolean isBlock
        Is this a begin of block token?
      • isIdBlock

        public boolean isIdBlock
        Is this a block with Id?
    • Constructor Detail

      • Scanner

        public Scanner​(java.io.Reader in)
                throws java.io.IOException
        Creates a new Scanner object.
        Parameters:
        in - The Reader used for reading input
        Throws:
        java.io.IOException - Never thrown
    • Method Detail

      • getNextToken

        public void getNextToken()
                          throws java.io.IOException
        Parses until the next token, skipping empty lines.
        Throws:
        java.io.IOException - If an I/O error occurs