Class iicm.vrml.pw.StrTokenizer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iicm.vrml.pw.StrTokenizer

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

public class StrTokenizer
extends Object
StrTokenizer - read VRML stream tokens Copyright (c) 1997 IICM

Constructor Index

 o StrTokenizer(InputStream)
construct a StrTokenizer for an InputStream.

Method Index

 o eof()
return flag whether end of file was reached
 o lineno()
current line number
 o nextChar()
look at next character without reading a new one.
 o putbackString(String)
put back a String.
 o readChar()
read a character (skips whitespace and comments)
 o readFloatValue()
read a floating point number.
 o readIdentifier()
read an identifier String (skips whitespace and comments)
 o readIntValue()
read an integer.
 o readLine(char[])
read a whole line (until \r or \n) into a char[] buffer.
 o readQuotedString()
read a quoted String ("...").
 o skipComment()
skip any amount of whitspace or comment.

Constructors

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

Methods

 o eof
  public boolean eof()
return flag whether end of file was reached
 o lineno
  public int lineno()
current line number
 o nextChar
  public int nextChar()
look at next character without reading a new one. returns -1 on eof
See Also:
skipComment
 o skipComment
  public void skipComment() throws IOException
skip any amount of whitspace or comment. called by all read operations
 o readLine
  public int readLine(char buf[]) throws 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
 o readChar
  public int readChar() throws IOException
read a character (skips whitespace and comments)
Returns:
character or -1 on EOF
 o readIdentifier
  public String readIdentifier() throws IOException
read an identifier String (skips whitespace and comments)
Returns:
null if no identifier could be read or non-zero length identifier string
 o readQuotedString
  public String readQuotedString() throws IOException
read a quoted String ("..."). the quotes themselves are not part of the String returned. returns empty string if next char is not '"'
 o readIntValue
  public int readIntValue() throws IOException
read an integer. format: [+-][0-9]* or [+-]0x[0-9A-Fa-f]*
 o readFloatValue
  public double readFloatValue() throws IOException
read a floating point number. format: [+-][0-9]*{[.][0-9]*}{[Ee][+-][0-9]*}
 o putbackString
  public void putbackString(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

All Packages  Class Hierarchy  This Package  Previous  Next  Index