|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.process.AbstractTokenizer<T>
public abstract class AbstractTokenizer<T>
An abstract tokenizer. Tokenizers extending AbstractTokenizer need only
implement the 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.
Field Summary | |
---|---|
protected T |
nextToken
|
Constructor Summary | |
---|---|
AbstractTokenizer()
|
Method Summary | |
---|---|
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. |
List |
tokenize()
Returns text as a List of tokens. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T nextToken
Constructor Detail |
---|
public AbstractTokenizer()
Method Detail |
---|
protected abstract T getNext()
public T next()
next
in interface Tokenizer<T>
next
in interface Iterator<T>
NoSuchElementException
- if the token stream has no more tokens.public boolean hasNext()
true
if this Tokenizer has more elements.
hasNext
in interface Tokenizer<T>
hasNext
in interface Iterator<T>
public void remove()
remove
in interface Tokenizer<T>
remove
in interface Iterator<T>
public T peek()
peek
in interface Tokenizer<T>
NoSuchElementException
- if the token stream has no more tokens.public List tokenize()
tokenize
in interface Tokenizer<T>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |