Package rma.util
Class rmaTokenizer
java.lang.Object
rma.util.rmaTokenizer
- All Implemented Interfaces:
Enumeration
-
Constructor Summary
ConstructorsConstructorDescriptionrmaTokenizer
(String str) Constructs a string tokenizer for the specified string.rmaTokenizer
(String str, String delim) Constructs a string tokenizer for the specified string.rmaTokenizer
(String str, String delim, boolean returnTokens) -
Method Summary
Modifier and TypeMethodDescriptionint
Calculates the number of times that this tokenizer'snextToken
method can be called before it generates an exception.getElement
(int element) boolean
Returns the same value as thehasMoreTokens
method.boolean
Tests if there are more tokens available from this tokenizer's string.Returns the same value as thenextToken
method, except that its declared return value isObject
rather thanString
.Returns the next token from this string tokenizer.Returns the next token in this string tokenizer's 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
-
rmaTokenizer
-
rmaTokenizer
Constructs a string tokenizer for the specified string. The characters in thedelim
argument are the delimiters for separating tokens. -
rmaTokenizer
Constructs a string tokenizer for the specified string. The tokenizer uses the default delimiter set, which is"\t\n\r"
: the space character, the tab character, the newline character, and the carriage-return character.
-
-
Method Details
-
hasMoreTokens
public boolean hasMoreTokens()Tests if there are more tokens available from this tokenizer's string.- Returns:
true
if there are more tokens available from this tokenizer's string;false
otherwise.- Since:
- SDK1.0
-
nextToken
Returns the next token from this string tokenizer.- Returns:
- the next token from this string tokenizer.
- Throws:
NoSuchElementException
- if there are no more tokens in this tokenizer's string.- Since:
- SDK1.0
-
nextToken
Returns the next token in this string tokenizer's string. The new delimiter set remains the default after this call.- Parameters:
delim
- the new delimiters.- Returns:
- the next token, after switching to the new delimiter set.
- Throws:
NoSuchElementException
- if there are no more tokens in this tokenizer's string.- Since:
- SDK1.0
-
hasMoreElements
public boolean hasMoreElements()Returns the same value as thehasMoreTokens
method. It exists so that this class can implement theEnumeration
interface.- Specified by:
hasMoreElements
in interfaceEnumeration
- Returns:
true
if there are more tokens;false
otherwise.- Since:
- SDK1.0
- See Also:
-
Enumeration
java.util.rmaTokenizer#hasMoreTokens()
-
nextElement
Returns the same value as thenextToken
method, except that its declared return value isObject
rather thanString
. It exists so that this class can implement theEnumeration
interface.- Specified by:
nextElement
in interfaceEnumeration
- Returns:
- the next token in the string.
- Throws:
NoSuchElementException
- if there are no more tokens in this tokenizer's string.- Since:
- SDK1.0
- See Also:
-
Enumeration
java.util.rmaTokenizer#nextToken()
-
countTokens
public int countTokens()Calculates the number of times that this tokenizer'snextToken
method can be called before it generates an exception.- Returns:
- the number of tokens remaining in the string using the current delimiter set.
- Since:
- SDK1.0
- See Also:
-
java.util.rmaTokenizer#nextToken()
-
getElement
-