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
-
StrTokenizer(InputStream)
- construct a StrTokenizer for an InputStream.
-
eof()
- return flag whether end of file was reached
-
lineno()
- current line number
-
nextChar()
- look at next character without reading a new one.
-
putbackString(String)
- put back a String.
-
readChar()
- read a character (skips whitespace and comments)
-
readFloatValue()
- read a floating point number.
-
readIdentifier()
- read an identifier String (skips whitespace and comments)
-
readIntValue()
- read an integer.
-
readLine(char[])
- read a whole line (until \r or \n) into a char[] buffer.
-
readQuotedString()
- read a quoted String ("...").
-
skipComment()
- skip any amount of whitspace or comment.
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
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 IOException
- skip any amount of whitspace or comment.
called by all read operations
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
readChar
public int readChar() throws IOException
- read a character (skips whitespace and comments)
- Returns:
- character or -1 on EOF
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
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 '"'
readIntValue
public int readIntValue() throws IOException
- read an integer. format: [+-][0-9]* or [+-]0x[0-9A-Fa-f]*
readFloatValue
public double readFloatValue() throws IOException
- read a floating point number. format: [+-][0-9]*{[.][0-9]*}{[Ee][+-][0-9]*}
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