nfa
Class NFAScanner

java.lang.Object
  extended by nfa.NFAScanner

public class NFAScanner
extends Object

A simple scanner to help process NFA input files. This class is modeled after Scanner.


Constructor Summary
NFAScanner()
          Create a new NFAScanner that reads input from the terminal.
NFAScanner(File f)
          Create a new NFAScanner that reads input from the File provided as a parameter.
 
Method Summary
 boolean hasNext()
          Return true if there is more input left.
 boolean hasNextInt()
          Return true if the next token in the input stream can be interpreted as in integer value.
 boolean hasNextIntList()
          Return true if the next token is an int list of the form (1,2,3).
 int nextInt()
          Return the next token, after converting it to an integer.
 Vector<Integer> nextIntList()
          Read an int list of the form (1,2,3) and return it as a Vector of integers.
 String nextLine()
          Return the next line of text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NFAScanner

public NFAScanner()
Create a new NFAScanner that reads input from the terminal.


NFAScanner

public NFAScanner(File f)
           throws IOException
Create a new NFAScanner that reads input from the File provided as a parameter.

Throws:
IOException
Method Detail

hasNextInt

public boolean hasNextInt()
Return true if the next token in the input stream can be interpreted as in integer value.


nextInt

public int nextInt()
Return the next token, after converting it to an integer. This method may throw an exception if the next token is not an integer.


hasNext

public boolean hasNext()
Return true if there is more input left.


nextLine

public String nextLine()
Return the next line of text.


hasNextIntList

public boolean hasNextIntList()
Return true if the next token is an int list of the form (1,2,3).


nextIntList

public Vector<Integer> nextIntList()
Read an int list of the form (1,2,3) and return it as a Vector of integers.