|
-bottom | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.csv4j.CSVTokenizer
public class CSVTokenizer
Provides an API similar to StringTokenizer
.
In addition to StringTokenizer's two interfaces, this class also supports the
Iterator interface.
It supports too many style of iterations as a result:
StringTokenizer
Constructor Summary | |
---|---|
CSVTokenizer(String line)
Creates a tokenizer from the specified CSV line. |
Method Summary | |
---|---|
int |
countTokens()
Indicates how many tokens are left. |
boolean |
hasMoreElements()
|
boolean |
hasMoreTokens()
Indicates if more tokens are available. |
boolean |
hasNext()
|
Iterator<String> |
iterator()
|
String |
next()
|
String |
nextElement()
|
String |
nextToken()
Returns the next token. |
void |
remove()
Not supported. |
void |
reset()
Reset the iterator back to the beginning. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVTokenizer(String line) throws ParseException
line
- string to tokenize
ParseException
- if the line cannot be tokenizedMethod Detail |
---|
public String nextToken()
nextToken
in interface Tokenizer<String>
public boolean hasMoreTokens()
hasMoreTokens
in interface Tokenizer<String>
public int countTokens()
Tokenizer.nextToken()
will cause the count to reduce.
countTokens
in interface Tokenizer<String>
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration<String>
public String nextElement()
nextElement
in interface Enumeration<String>
public boolean hasNext()
hasNext
in interface Iterator<String>
public String next()
next
in interface Iterator<String>
public void remove()
remove
in interface Iterator<String>
RuntimeException
- always thrownpublic void reset()
public Iterator<String> iterator()
iterator
in interface Iterable<String>
|
-bottom | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |