anl.aida.ae.lucene
Class TokenStreamBuilder

java.lang.Object
  extended by anl.aida.ae.lucene.TokenStreamBuilder

public class TokenStreamBuilder
extends java.lang.Object

Builds a TokenStream instance using user supplied Tokens.


Nested Class Summary
private static class TokenStreamBuilder.StringTokenStream
           
 
Field Summary
private  java.util.List<java.lang.String> tokens
           
 
Constructor Summary
TokenStreamBuilder()
           
 
Method Summary
 void addToken(java.lang.String token)
          Adds a String to be returned as an individual Token.
 org.apache.lucene.analysis.TokenStream buildTokenStream()
          Builds a TokenStream that will return all the Tokens added up to now.
 void clear()
          Clears the list of tokens.
 int tokenCount()
          Gets the number of tokens that have been added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokens

private java.util.List<java.lang.String> tokens
Constructor Detail

TokenStreamBuilder

public TokenStreamBuilder()
Method Detail

addToken

public void addToken(java.lang.String token)
Adds a String to be returned as an individual Token.

Parameters:
token - the string token.

buildTokenStream

public org.apache.lucene.analysis.TokenStream buildTokenStream()
Builds a TokenStream that will return all the Tokens added up to now.

Returns:
a TokenStream that will return all the Tokens added up to now.

tokenCount

public int tokenCount()
Gets the number of tokens that have been added.

Returns:
the number of tokens that have been added.

clear

public void clear()
Clears the list of tokens.