Package mgui.util
Class PowerfulTokenizer
java.lang.Object
mgui.util.PowerfulTokenizer
- All Implemented Interfaces:
java.util.Enumeration
public class PowerfulTokenizer
extends java.lang.Object
implements java.util.Enumeration
-
Constructor Summary
Constructors Constructor Description PowerfulTokenizer(java.lang.String str, java.lang.String sep)
ConstructorPowerfulTokenizer(java.lang.String str, java.lang.String sep, boolean bIncludeDelim)
Constructor -
Method Summary
Modifier and Type Method Description int
countTokens()
Total number of tokens present in the input stringboolean
hasMoreElements()
Checks whether any token is left in the input stringboolean
hasMoreTokens()
Checks whether any token is left in the input stringstatic void
main(java.lang.String[] args)
java.lang.Object
nextElement()
Returns the next token from the input string.java.lang.String
nextToken()
Returns the next token from the input string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Enumeration
asIterator
-
Constructor Details
-
PowerfulTokenizer
public PowerfulTokenizer(java.lang.String str, java.lang.String sep)Constructor- Parameters:
str
- the input stringsep
- the delimiter string
-
PowerfulTokenizer
public PowerfulTokenizer(java.lang.String str, java.lang.String sep, boolean bIncludeDelim)Constructor- Parameters:
str
- the input stringsep
- the delimiter stringbIncludeDelim
- if true, include delimiters as tokens
-
-
Method Details
-
nextToken
public java.lang.String nextToken()Returns the next token from the input string.- Returns:
- String the current token from the input string.
-
hasMoreTokens
public boolean hasMoreTokens()Checks whether any token is left in the input string- Returns:
- boolean true, if any token is left
-
hasMoreElements
public boolean hasMoreElements()Checks whether any token is left in the input string- Specified by:
hasMoreElements
in interfacejava.util.Enumeration
- Returns:
- boolean true, if any token is left
-
nextElement
public java.lang.Object nextElement()Returns the next token from the input string.- Specified by:
nextElement
in interfacejava.util.Enumeration
- Returns:
- Object the current token from the input string.
-
countTokens
public int countTokens()Total number of tokens present in the input string- Returns:
- int total number of tokens
-
main
public static void main(java.lang.String[] args)
-