org.apache.james.ai.classic
Class TokenCollector

java.lang.Object
  extended by org.apache.james.ai.classic.Tokenizer
      extended by org.apache.james.ai.classic.TokenCollector

public class TokenCollector
extends Tokenizer

Collects tokens.


Constructor Summary
TokenCollector(Collection<String> tokens)
          Constructs a collector which collects tokens into the given collection.
 
Method Summary
 TokenCollector collect(Reader stream)
          Collects tokens from stream.
protected  void next(String token)
          Adds the token to the collection.
 
Methods inherited from class org.apache.james.ai.classic.Tokenizer
doTokenize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenCollector

public TokenCollector(Collection<String> tokens)
Constructs a collector which collects tokens into the given collection.

Parameters:
tokens - not null
Method Detail

collect

public TokenCollector collect(Reader stream)
                       throws IOException
Collects tokens from stream.

Parameters:
stream - not null
Returns:
this, not null
Throws:
IOException

next

protected void next(String token)
Adds the token to the collection.

Specified by:
next in class Tokenizer
Parameters:
token - not null


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.