|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tokenizer<T>
Tokenizers break up text into individual Objects. These objects may be
Strings, Words, or other Objects. A Tokenizer extends the Iterator
interface, but provides a lookahead operation peek()
. An
implementation of this interface is expected to have a constructor that
takes a single argument, a Reader.
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if and only if this Tokenizer has more elements. |
T |
next()
Returns the next token from this Tokenizer. |
T |
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<T> |
tokenize()
Returns all tokens of this Tokenizer as a List for convenience. |
Method Detail |
---|
T next()
next
in interface Iterator<T>
NoSuchElementException
- if the token stream has no more tokens.boolean hasNext()
true
if and only if this Tokenizer has more elements.
hasNext
in interface Iterator<T>
void remove()
remove
in interface Iterator<T>
T peek()
NoSuchElementException
- if the token stream has no more tokens.List<T> tokenize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |