kiurubeans
Class PhraseStringTokenizer

java.lang.Object
  |
  +--kiurubeans.PhraseStringTokenizer
All Implemented Interfaces:
java.util.Enumeration

public class PhraseStringTokenizer
extends java.lang.Object
implements java.util.Enumeration

A String tokenizer-like class that supports phrases. Delimiters inside phrases are ignored.


Constructor Summary
PhraseStringTokenizer(java.lang.String str, java.lang.String delim, java.lang.String phraseDelim)
          Creates a new instance of PhraseStringTokenizer
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
static void main(java.lang.String[] args)
          Unit test.
 java.lang.Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 java.lang.String nextToken()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhraseStringTokenizer

public PhraseStringTokenizer(java.lang.String str,
                             java.lang.String delim,
                             java.lang.String phraseDelim)
Creates a new instance of PhraseStringTokenizer

Parameters:
str - String to parse
delim - Delimiters used
phraseDelim - Phrase delimiters used
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

nextElement

public java.lang.Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide. For example: Let input = a|b|"c"|d Returns
a
b
"c"
d

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next element of this enumeration.

nextToken

public java.lang.String nextToken()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide. For example: Let input = a|b|"c"|d Returns
a
b
"c"
d

Returns:
the next element of this enumeration.

main

public static void main(java.lang.String[] args)
Unit test.

Parameters:
args - command line arguments (not used).