| 
 | " 2013 FRC Java API" | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.squawk.util.StringTokenizer
public class StringTokenizer
StringTokenizer is a class that controls simple linear tokenization of a String. The set of delimiters, which defaults to common whitespace characters, may be specified at creation time or on a per-token basis.
Example usage:
        String s = "this is a test";
        StringTokenizer st = new StringTokenizer(s);
        while (st.hasMoreTokens()) {
                println(st.nextToken());
        }
 
 Prints the following on the console:
 
        this
        is
        a
        test
 
| Constructor Summary | |
|---|---|
| StringTokenizer(String str)Constructs a StringTokenizer on the specified String, using the default delimiter set (which is " \t\n\r"). | |
| StringTokenizer(String str,
                String delim)Constructs a StringTokenizer on the specified String, using the specified delimiter set. | |
| StringTokenizer(String str,
                String delim,
                boolean returnTokens)Constructs a StringTokenizer on the specified String, using the specified delimiter set. | |
| Method Summary | |
|---|---|
|  int | countTokens()Returns the next number of tokens in the String using the current deliminter set. | 
|  boolean | hasMoreElements()Returns true if the Enumeration has more elements. | 
|  boolean | hasMoreTokens()Returns true if more tokens exist. | 
|  Object | nextElement()Returns the next element in the Enumeration. | 
|  String | nextToken()Returns the next token of the String. | 
|  String | nextToken(String delim)Returns the next token, after switching to the new delimiter set. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public StringTokenizer(String str,
                       String delim,
                       boolean returnTokens)
str - the input Stringdelim - the delimiter StringreturnTokens - returns delimiters as tokens or skip them
public StringTokenizer(String str,
                       String delim)
str - the input Stringdelim - the delimiter Stringpublic StringTokenizer(String str)
str - the String| Method Detail | 
|---|
public boolean hasMoreTokens()
public String nextToken()
NoSuchElementException - If there are no more 
 tokens in the String.public String nextToken(String delim)
delim - the new delimiterspublic boolean hasMoreElements()
hasMoreElements in interface Enumerationtrue if and only if this enumeration object
           contains at least one more element to provide;
          false otherwise.public Object nextElement()
nextElement in interface EnumerationNoSuchElementException - If there are no more elements 
 in the enumeration.public int countTokens()
| 
 | " 2013 FRC Java API" | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||