iicm.vrml.pw
Class StrTokenizer

java.lang.Object
  |
  +--iicm.vrml.pw.StrTokenizer

public class StrTokenizer
extends java.lang.Object

StrTokenizer - read VRML stream tokens


Constructor Summary
StrTokenizer(java.io.InputStream is)
          construct a StrTokenizer for an InputStream.
 
Method Summary
 boolean eof()
          return flag whether end of file was reached
 int lineno()
          current line number
 int nextChar()
          look at next character without reading a new one. returns -1 on eof
 void putbackString(java.lang.String s)
          put back a String.
 int readChar()
          read a character (skips whitespace and comments)
 double readFloatValue()
          read a floating point number. format: [+-][0-9]*{[.][0-9]*}{[Ee][+-][0-9]*}
 java.lang.String readIdentifier()
          read an identifier String (skips whitespace and comments)
 int readIntValue()
          read an integer. format: [+-][0-9]* or [+-]0x[0-9A-Fa-f]*
 int readLine(char[] buf)
          read a whole line (until \r or \n) into a char[] buffer. if the line is longer than the buffer, the rest is skipped. the newline character is not appended to the buffer
 java.lang.String readQuotedString()
          read a quoted String ("..."). the quotes themselves are not part of the String returned. returns empty string if next char is not '"'
 void skipComment()
          skip any amount of whitspace or comment. called by all read operations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrTokenizer

public StrTokenizer(java.io.InputStream is)
construct a StrTokenizer for an InputStream. StrTokenizer does buffering on the input stream. current implementation blocks to read first character from stream
Method Detail

eof

public boolean eof()
return flag whether end of file was reached

lineno

public int lineno()
current line number

nextChar

public int nextChar()
look at next character without reading a new one. returns -1 on eof
See Also:
skipComment

skipComment

public void skipComment()
                 throws java.io.IOException
skip any amount of whitspace or comment. called by all read operations

readLine

public int readLine(char[] buf)
             throws java.io.IOException
read a whole line (until \r or \n) into a char[] buffer. if the line is longer than the buffer, the rest is skipped. the newline character is not appended to the buffer
Returns:
the no. of chars written into buf

readChar

public int readChar()
             throws java.io.IOException
read a character (skips whitespace and comments)
Returns:
character or -1 on EOF

readIdentifier

public java.lang.String readIdentifier()
                                throws java.io.IOException
read an identifier String (skips whitespace and comments)
Returns:
null if no identifier could be read or non-zero length identifier string

readQuotedString

public java.lang.String readQuotedString()
                                  throws java.io.IOException
read a quoted String ("..."). the quotes themselves are not part of the String returned. returns empty string if next char is not '"'

readIntValue

public int readIntValue()
                 throws java.io.IOException
read an integer. format: [+-][0-9]* or [+-]0x[0-9A-Fa-f]*

readFloatValue

public double readFloatValue()
                      throws java.io.IOException
read a floating point number. format: [+-][0-9]*{[.][0-9]*}{[Ee][+-][0-9]*}

putbackString

public void putbackString(java.lang.String s)
put back a String. In order to not further slow down reading of numbers, their string representation is not remembered by this class