|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmoka.lang.Object
moka.util.StringTokenizer
The string tokenizer class allows an application to break a string into tokens. The delimiters (the characters that separate tokens) may be specified either at creation time or on a per-token basis.
Field Summary | |
int |
currentPosition
The index of the current char in the string. |
Constructor Summary | |
StringTokenizer(java.lang.String str)
Constructs a string tokenizer for the specified string. |
|
StringTokenizer(java.lang.String str,
java.lang.String delim)
Constructs a string tokenizer for the specified string. |
Method Summary | |
int |
countTokens()
Calculates the number of times that this tokenizer's nextToken method can be called. |
void |
finalize()
Frees the memory of system ressources used by this StringTokenizer object. |
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. |
java.lang.String |
nextToken(java.lang.String delim)
Returns the next token in this string tokenizer's string. |
void |
setCurrentPosition(int currentPosition)
Sets the current position to the specified index. |
Methods inherited from class moka.lang.Object |
equals, getClassName, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int currentPosition
Constructor Detail |
public StringTokenizer(java.lang.String str)
str
- a string to be parsed.public StringTokenizer(java.lang.String str, java.lang.String delim)
delim
argument is the delimiters
for separating tokens. If the string objects risk to be used later, use a copy of the string objects
instead of the originals, the strings being finalized before the method returns.
str
- a string to be parsed.delim
- the delimiter.Method Detail |
public void finalize()
finalize
in class Object
public boolean hasMoreTokens()
true
if and only if there is at least one token
in the string after the current position; false
otherwise.public java.lang.String nextToken()
public java.lang.String nextToken(java.lang.String delim)
delim
- the new delimiters.
public int countTokens()
nextToken
method can be called. The current
position is not advanced.
public void setCurrentPosition(int currentPosition)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |