|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Tokenizers break up text into individual Objects. These objects may be Strings, Words, or
other Objects. This Tokenizer interface allows the source to be set upon construction, or
to be reset using the setSource(Reader r)
method. Thus each Tokenizer instance
may be used for one data source or several.
Method Summary | |
boolean |
hasNext()
Returns true if this Tokenizer has more elements. |
Object |
next()
Returns the next token from this Tokenizer. |
void |
pushBack()
Pushes the last token returned back on this Tokenizer, so that it will be returned again in the next call to next() . |
void |
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). |
void |
setSource(Reader r)
Sets the source for this Tokenizer. |
List |
tokenize()
Returns all tokens of this Tokenizer as a List for convenience. |
Method Detail |
public Object next()
next
in interface Iterator
public boolean hasNext()
true
if this Tokenizer has more elements.
hasNext
in interface Iterator
public void remove()
remove
in interface Iterator
public void pushBack()
next()
.
public List tokenize()
public void setSource(Reader r)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |