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 intcountTokens()Total number of tokens present in the input stringbooleanhasMoreElements()Checks whether any token is left in the input stringbooleanhasMoreTokens()Checks whether any token is left in the input stringstatic voidmain(java.lang.String[] args)java.lang.ObjectnextElement()Returns the next token from the input string.java.lang.StringnextToken()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, waitMethods 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:
hasMoreElementsin 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:
nextElementin 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)
-