LUCENE-1693: Add AttributeSource ctors to Tokenizer

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@797727 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-07-25 09:23:07 +00:00
parent c311d5730c
commit 187ac2b4f3
1 changed files with 19 additions and 1 deletions

View File

@ -38,16 +38,34 @@ public abstract class Tokenizer extends TokenStream {
/** Construct a tokenizer with null input. */
protected Tokenizer() {}
/** Construct a token stream processing the given input. */
protected Tokenizer(Reader input) {
this.input = CharReader.get(input);
}
/** Construct a token stream processing the given input. */
protected Tokenizer(CharStream input) {
this.input = input;
}
/** Construct a tokenizer with null input using the given AttributeFactory. */
protected Tokenizer(AttributeFactory factory) {
super(factory);
}
/** Construct a token stream processing the given input using the given AttributeFactory. */
protected Tokenizer(AttributeFactory factory, Reader input) {
super(factory);
this.input = CharReader.get(input);
}
/** Construct a token stream processing the given input using the given AttributeFactory. */
protected Tokenizer(AttributeFactory factory, CharStream input) {
super(factory);
this.input = input;
}
/** By default, closes the input Reader. */
public void close() throws IOException {
input.close();