|
||||||||||
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. |
Object |
peek()
Returns the next token, without removing it, from the Tokenizer, so that the same token will be again returned on the next call to next() or peek(). |
void |
remove()
Removes from the underlying collection the last element returned by the iterator. |
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 Object peek()
public List tokenize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |