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.


Field Summary
(package private)  boolean boolStringRead
           
(package private)  char chr
           
(package private)  java.lang.String CLS
           
(package private)  boolean getOneFirst
           
 double nval
           
(package private)  java.io.Reader reader
           
 java.lang.String sval
           
static int TT_EOF
           
static int TT_NONE
           
static int TT_STRING
           
static int TT_WORD
           
 int ttype
           
 
Constructor Summary
ChatStreamTokenizer(java.io.Reader rdr)
          Constructor.
 
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
 

Field Detail

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
Constructor Detail

ChatStreamTokenizer

public ChatStreamTokenizer(java.io.Reader rdr)
Constructor.
Parameters:
rdr - The reader on which the tokenizer should work.
Method Detail

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.