Added some more javadocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@599833 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2007-11-30 14:38:30 +00:00
parent 97fbfb5427
commit cad3d26ca4
1 changed files with 12 additions and 4 deletions

View File

@ -22,8 +22,11 @@ public class SinkTokenizer extends Tokenizer {
} }
/** /**
* only valid if tokens have not been consumed, * Get the tokens in the internal List.
* i.e. if this tokenizer is not part of another tokenstream * <p/>
* WARNING: Adding tokens to this list requires the {@link #reset()} method to be called in order for them
* to be made available. Also, this Tokenizer does nothing to protect against {@link java.util.ConcurrentModificationException}s
* in the case of adds happening while {@link #next(org.apache.lucene.analysis.Token)} is being called.
* *
* @return A List of {@link org.apache.lucene.analysis.Token}s * @return A List of {@link org.apache.lucene.analysis.Token}s
*/ */
@ -32,8 +35,8 @@ public class SinkTokenizer extends Tokenizer {
} }
/** /**
* Ignores the input result Token * Ignores the input result Token and returns the next token out of the list of cached tokens
* @param result * @param result The input token
* @return The next {@link org.apache.lucene.analysis.Token} in the Sink. * @return The next {@link org.apache.lucene.analysis.Token} in the Sink.
* @throws IOException * @throws IOException
*/ */
@ -53,6 +56,11 @@ public class SinkTokenizer extends Tokenizer {
lst.add((Token) t.clone()); lst.add((Token) t.clone());
} }
/**
* Reset the internal data structures to the start at the front of the list of tokens. Should be called
* if tokens were added to the list after an invocation of {@link #next(Token)}
* @throws IOException
*/
public void reset() throws IOException { public void reset() throws IOException {
iter = lst.iterator(); iter = lst.iterator();
} }