superwaba.ext.xplat.util
Class StrTokenizer

java.lang.Object
  |
  +--superwaba.ext.xplat.util.StrTokenizer

public class StrTokenizer
extends java.lang.Object

A simple String tokenizer, like the one implemented in JDK.


Constructor Summary
StrTokenizer(java.lang.String s, java.lang.String delimiter)
          Constructs a string tokenizer for the specified string.
 
Method Summary
 boolean hasMoreTokens()
          Tests if there are more tokens available from this tokenizer's string.
 java.lang.String nextToken()
          Returns the next Token from this String Tokenizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrTokenizer

public StrTokenizer(java.lang.String s,
                    java.lang.String delimiter)
Constructs a string tokenizer for the specified string. The characters in the delim argument are the delimiters for separating tokens. Delimiter characters themselves will not be treated as tokens.
Parameters:
s - a string to be parsed.
delimiter - the delimiter
Method Detail

hasMoreTokens

public boolean hasMoreTokens()
Tests if there are more tokens available from this tokenizer's string. If this method returns true , then a subsequent call to nextToken with no argument will successfully return a token.
Returns:
true if there are more tokens, otherwise false

nextToken

public java.lang.String nextToken()
Returns the next Token from this String Tokenizer. If there are two delimiters after each other, an empty Token will be returned. If there is no delimiter in this String, the whole String will be returned. If the String ends with the delimiter, the last Token returned will be an empty one.
Returns:
the next Token as String representative