analyzer.util
Class SciStreamTokenizer

java.lang.Object
  |
  +--java.io.StreamTokenizer
        |
        +--analyzer.util.SciStreamTokenizer

public class SciStreamTokenizer
extends java.io.StreamTokenizer

Extends StreamTokenizer so that it recognizes doubles in the Scientific format. The approach is to read everything as words (no numbers) and then have nextToken check if word is a double, using the standard function java.lang.Double.valueOf(). To do this we must replace the parseNumbers settings with a boolean flag, doParseNumbers, and make sure numbers are read as words.


Fields inherited from class java.io.StreamTokenizer
nval, sval, TT_EOF, TT_EOL, TT_NUMBER, TT_WORD, ttype
 
Constructor Summary
SciStreamTokenizer(java.io.Reader is)
           
 
Method Summary
 int nextToken()
           
 void parseNumbers()
           
 void resetSyntax()
           
 
Methods inherited from class java.io.StreamTokenizer
commentChar, eolIsSignificant, lineno, lowerCaseMode, ordinaryChar, ordinaryChars, pushBack, quoteChar, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SciStreamTokenizer

public SciStreamTokenizer(java.io.Reader is)
Method Detail

parseNumbers

public void parseNumbers()
Overrides:
parseNumbers in class java.io.StreamTokenizer

resetSyntax

public void resetSyntax()
Overrides:
resetSyntax in class java.io.StreamTokenizer

nextToken

public int nextToken()
              throws java.io.IOException
Overrides:
nextToken in class java.io.StreamTokenizer


Email questions and comments to
shumway@uiuc.edu or nzhong@ncsa.uiuc.edu