com.twitter.common.text.token
Class TokenStreamAggregator

java.lang.Object
  extended by org.apache.lucene.util.AttributeSource
      extended by com.twitter.common.text.token.TokenStream
          extended by com.twitter.common.text.token.TokenStreamAggregator

public class TokenStreamAggregator
extends TokenStream

Aggregates the outputs of multiple TokenStreams into a single TokenStream.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
org.apache.lucene.util.AttributeSource.AttributeFactory, org.apache.lucene.util.AttributeSource.State
 
Constructor Summary
protected TokenStreamAggregator(TokenStream... streams)
           
 
Method Summary
 boolean incrementToken()
          Consumers call this method to advance the stream to the next token.
static TokenStream of(TokenStream... streams)
          Creates a TokenStream that aggregates the outputs of a given set of TokenStreams.
 void reset(CharSequence input)
          Resets this TokenStream (and also downstream tokens if they exist) to parse a new input.
 
Methods inherited from class com.twitter.common.text.token.TokenStream
getInstanceOf, toStringList
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenStreamAggregator

protected TokenStreamAggregator(TokenStream... streams)
Method Detail

of

public static final TokenStream of(TokenStream... streams)
Creates a TokenStream that aggregates the outputs of a given set of TokenStreams.

Parameters:
streams - TokenStreams to aggregate
Returns:
an aggregated TokenStream

incrementToken

public boolean incrementToken()
Description copied from class: TokenStream
Consumers call this method to advance the stream to the next token.

Specified by:
incrementToken in class TokenStream
Returns:
false for end of stream; true otherwise

reset

public void reset(CharSequence input)
Description copied from class: TokenStream
Resets this TokenStream (and also downstream tokens if they exist) to parse a new input.

Specified by:
reset in class TokenStream
Parameters:
input - new text to parse.