Class graph.ScanString
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class graph.ScanString

java.lang.Object
   |
   +----graph.ScanString

public class ScanString
extends Object
This class is similar to the ScanWord class, except it scans a string for keywords rather than an input stream.
Version:
1.5, 1996/07/12 00:35:49
Author:
Leigh Brookshaw

Variable Index

 o EOS
flag the End of String
 o ERROR
Flag an error
 o NUMBER
Flag a Number
 o nval
 o sval
 o UNKNOWN
flag an unknown token

Constructor Index

 o ScanString()
Instantiate the Class
 o ScanString(String)
Instantaite the Class

Method Index

 o addKeyWord(String, int)
Add a keyword/token pair to the table of keywords to scan for.
 o getKeyValue(String)
 o nextWord()
Process the string and return the next token found.
 o resetKeyWords()
Clear the table containing the keyword/token pairs
 o setString(String)
Set the string to be scanned

Variables

 o UNKNOWN
  public final static int UNKNOWN
flag an unknown token
 o ERROR
  public final static int ERROR
Flag an error
 o NUMBER
  public final static int NUMBER
Flag a Number
 o EOS
  public final static int EOS
flag the End of String
 o sval
  public String sval
 o nval
  public double nval

Constructors

 o ScanString
  public ScanString()
Instantiate the Class
 o ScanString
  public ScanString(String s)
Instantaite the Class
Parameters:
s - String to scan for tokens

Methods

 o setString
  public void setString(String s)
Set the string to be scanned
Parameters:
s - String
 o addKeyWord
  public void addKeyWord(String s,
                         int i)
Add a keyword/token pair to the table of keywords to scan for.
Parameters:
s - keyword string to scan for
i - token to return when the keyword is found
 o getKeyValue
  public int getKeyValue(String s)
Parameters:
s - keyword string
Returns:
the token corresponding to the keyword
 o resetKeyWords
  public void resetKeyWords()
Clear the table containing the keyword/token pairs
 o nextWord
  public int nextWord()
Process the string and return the next token found.
Returns:
token found

All Packages  Class Hierarchy  This Package  Previous  Next  Index