FileDocCategorySizeDatePackage
KeywordTokenizer.javaAPI DocApache Lucene 1.91569Mon Feb 20 09:19:46 GMT 2006org.apache.lucene.analysis

KeywordTokenizer

public class KeywordTokenizer extends Tokenizer
Emits the entire input as a single token.

Fields Summary
private static final int
DEFAULT_BUFFER_SIZE
private boolean
done
private final char[]
buffer
Constructors Summary
public KeywordTokenizer(Reader input)


     
    this(input, DEFAULT_BUFFER_SIZE);
  
public KeywordTokenizer(Reader input, int bufferSize)

    super(input);
    this.buffer = new char[bufferSize];
    this.done = false;
  
Methods Summary
public org.apache.lucene.analysis.Tokennext()

    if (!done) {
      done = true;
      StringBuffer buffer = new StringBuffer();
      int length;
      while (true) {
        length = input.read(this.buffer);
        if (length == -1) break;

        buffer.append(this.buffer, 0, length);
      }
      String text = buffer.toString();
      return new Token(text, 0, text.length());
    }
    return null;