net.rimlib.blackberry.api.paymentsdk
Class SimpleStringTokenizer

java.lang.Object
  extended by net.rimlib.blackberry.api.paymentsdk.SimpleStringTokenizer

public final class SimpleStringTokenizer
extends java.lang.Object

Simple string tokenizer utility class. Create an instance by providing an input string and a delimiter character. Use hasMoreTokens() to check if there are any more tokens. Use nextToken() to get the next token.


Constructor Summary
SimpleStringTokenizer(java.lang.String string, char delimiter)
          Creates a new SimpleStringTokenizer.
 
Method Summary
 boolean hasMoreTokens()
          Returns true if there are more tokens, false otherwise.
 java.lang.String nextToken()
          Returns the next token if there are any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleStringTokenizer

public SimpleStringTokenizer(java.lang.String string,
                             char delimiter)
Creates a new SimpleStringTokenizer. Throws exception if string is null.

Parameters:
string - input string to tokenize. Should not be null.
delimiter - delimiting character
Throws:
java.lang.IllegalArgumentException
Method Detail

hasMoreTokens

public boolean hasMoreTokens()
Returns true if there are more tokens, false otherwise.

Returns:
true if there are more tokens, false otherwise.

nextToken

public java.lang.String nextToken()
Returns the next token if there are any. Basic usage is to call hasMoreTokens() first. If there are no more tokens, exception is thrown.

Returns:
the next token
Throws:
java.lang.IllegalStateException - if there are no more tokens left