public class Tokenizer extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
circular |
protected String |
delimiters |
protected StringTokenizer |
st |
protected String |
string |
Constructor and Description |
---|
Tokenizer(String string,
String delimiters)
Create a new tokenizer on the string and using the given delimiter
characters.
|
Tokenizer(String string,
String delimiters,
boolean circular)
Create a new tokenizer on the string and using the given delimiter
characters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
circular()
Returns true if the tokenizer is marked as a circular one.
|
String |
delimiters()
Get the delimiters string.
|
boolean |
hasNext()
Determine if there are any more tokens to be parsed.
|
String |
next()
Get the next token string.
|
int |
nextInt()
Get the next token as an integer.
|
long |
nextLong()
Get the next token as a long.
|
void |
reset()
Reset the tokenizer to point to the beginning of the original string.
|
String |
string()
Get the underlying string used to construct the tokenizer.
|
protected StringTokenizer st
protected String string
protected String delimiters
protected boolean circular
public Tokenizer(String string, String delimiters)
string
- string to be tokenizeddelimiters
- string of delimiterspublic void reset()
public boolean hasNext()
public String next()
public int nextInt()
public long nextLong()
public boolean circular()
public String string()
public String delimiters()
Copyright © 2015. All Rights Reserved.