public abstract class AbstractTokenizer<T> extends java.lang.Object implements Tokenizer<T>
getNext()
method. This implementation does not allow null
tokens, since null is used in the protected nextToken field to signify that no more tokens are available.Constructor and Description |
---|
AbstractTokenizer() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
getNext()
Internally fetches the next token.
|
boolean |
hasNext()
Returns
true if this Tokenizer has more elements. |
T |
next()
Returns the next token from this Tokenizer.
|
T |
peek()
This is an optional operation, by default supported.
|
void |
remove()
This is an optional operation, by default not supported.
|
java.util.List<T> |
tokenize()
Returns text as a List of tokens.
|
protected T nextToken
protected abstract T getNext()
public T next()
public boolean hasNext()
true
if this Tokenizer has more elements.public void remove()
public T peek()