org.argouml.util
Class TokenSep

java.lang.Object
  extended byorg.argouml.util.TokenSep

class TokenSep
extends Object

Internal class for managing the delimiters in MyTokenizer. It's rather similar to CustomSeparator, but faster for short constant strings.


Field Summary
private  int length
           
private  TokenSep next
           
private  int pattern
           
private  String theString
           
 
Constructor Summary
TokenSep(String str)
          Constructs a TokenSep that will match the String given in str.
 
Method Summary
 boolean addChar(char c)
          Called by MyTokenizer when a new character is processed in the sequence.
 TokenSep getNext()
           
 String getString()
          Gets this token.
 int length()
          Gets the length of this token.
 void reset()
          Called by MyTokenizer before starting scanning for a new token.
 void setNext(TokenSep n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

private TokenSep next

theString

private final String theString

length

private final int length

pattern

private int pattern
Constructor Detail

TokenSep

public TokenSep(String str)
Constructs a TokenSep that will match the String given in str.

Parameters:
str - The delimiter string.
Method Detail

addChar

public boolean addChar(char c)
Called by MyTokenizer when a new character is processed in the sequence. Returns true if we have found the delimiter.


reset

public void reset()
Called by MyTokenizer before starting scanning for a new token.


length

public int length()
Gets the length of this token.


getString

public String getString()
Gets this token.


setNext

public void setNext(TokenSep n)
Parameters:
n - The next to set.

getNext

public TokenSep getNext()
Returns:
Returns the next.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook