|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.StringTokenizer edu.umd.cfar.lamp.viper.util.reader.CountingStringTokenizer
This class extends the StringTokenizer to also maintain a character index of each new token for error reporting.
Constructor Summary | |
CountingStringTokenizer(java.lang.String str)
Constructs a new string tokenizer with the default delimiters and does not return them as tokens. |
|
CountingStringTokenizer(java.lang.String str,
java.lang.String delim)
Constructs a new tokenizer with the given string and tokens. |
|
CountingStringTokenizer(java.lang.String str,
java.lang.String delim,
boolean returnTokens)
Constructs a new tokenizer with the given string and tokens, while allowing the delimiters to be returned as tokens. |
Method Summary | |
int |
countTokens()
Unsupported operation. |
int |
getEnd()
Get the index into the parent string of the last character of the most recently returned token. |
int |
getStart()
Get the index into the parent string of the first character of the most recently returned token. |
boolean |
hasMoreElements()
Tests to see if more tokens remain. |
boolean |
hasMoreTokens()
Tests to see if more tokens remain. |
java.lang.Object |
nextElement()
Gets the next token |
java.lang.String |
nextToken()
Gets the next token |
java.lang.String |
nextToken(java.lang.String delim)
Unsupported operation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CountingStringTokenizer(java.lang.String str)
str
- the string to chop uppublic CountingStringTokenizer(java.lang.String str, java.lang.String delim)
str
- the string to chop updelim
- the characters to use as delimiterspublic CountingStringTokenizer(java.lang.String str, java.lang.String delim, boolean returnTokens)
str
- the string to chop updelim
- the characters to use as delimitersreturnTokens
- true
if you would
like all characters to be returned, not just non-delimsMethod Detail |
public int getEnd()
public int getStart()
public int countTokens()
java.lang.UnsupportedOperationException
public boolean hasMoreElements()
true
if next returns
an element, instead of throwing an exception.public boolean hasMoreTokens()
true
if next returns
an element, instead of throwing an exception.public java.lang.Object nextElement()
java.util.NoSuchElementException
public java.lang.String nextToken()
java.util.NoSuchElementException
public java.lang.String nextToken(java.lang.String delim)
delim
- the delimiters to switch to
java.util.NoSuchElementException
java.lang.UnsupportedOperationException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |