swpchat.protocol
Class ChatStreamTokenizer
java.lang.Object
|
+--swpchat.protocol.ChatStreamTokenizer
- public class ChatStreamTokenizer
- extends java.lang.Object
This class parses tokens from an input stream in the
swpchat.protocol sense.
Method Summary |
private char |
getChar(java.io.Reader rdr)
|
Token |
getNextToken()
Gets next Token from Stream. |
private boolean |
isQuoteChar(char chr)
Returns true, if the character is a quote char. |
private boolean |
isStrDelim(char chr)
Returns true, if the character is a delimitter. |
private boolean |
isWordChar(char chr)
Returns true, if the character is a word char. |
void |
nextToken()
reads next token from stream. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
CLS
final java.lang.String CLS
TT_NONE
public static final int TT_NONE
TT_STRING
public static final int TT_STRING
TT_WORD
public static final int TT_WORD
TT_EOF
public static final int TT_EOF
sval
public java.lang.String sval
nval
public double nval
ttype
public int ttype
chr
char chr
reader
java.io.Reader reader
boolStringRead
boolean boolStringRead
getOneFirst
boolean getOneFirst
ChatStreamTokenizer
public ChatStreamTokenizer(java.io.Reader rdr)
- Constructor.
- Parameters:
rdr
- The reader on which the tokenizer should work.
isQuoteChar
private boolean isQuoteChar(char chr)
- Returns true, if the character is a quote char.
isStrDelim
private boolean isStrDelim(char chr)
- Returns true, if the character is a delimitter.
isWordChar
private boolean isWordChar(char chr)
- Returns true, if the character is a word char.
getChar
private char getChar(java.io.Reader rdr)
throws java.io.IOException
nextToken
public void nextToken()
throws java.io.IOException
- reads next token from stream.
- Throws:
java.io.IOException
- if problems on inputstream occure
getNextToken
public Token getNextToken()
throws java.io.IOException
- Gets next Token from Stream. Should be used instead of void nextToken.