org.compass.core.lucene.engine.highlighter.support
Class MultiValueTokenStream

java.lang.Object
  extended by org.apache.lucene.analysis.TokenStream
      extended by org.compass.core.lucene.engine.highlighter.support.MultiValueTokenStream

public class MultiValueTokenStream
extends TokenStream

Helper class which creates a single TokenStream out of values from a multi-valued field.

Author:
kimchy

Constructor Summary
MultiValueTokenStream(String fieldName, String[] values, Analyzer analyzer, boolean orderTokenOffsets)
          Constructs a TokenStream for consecutively-analyzed field values
 
Method Summary
 String asSingleValue()
          Returns all values as a single String into which the Tokens index with their offsets.
 Token next()
          Returns the next token in the stream, or null at EOS.
 
Methods inherited from class org.apache.lucene.analysis.TokenStream
close, next, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiValueTokenStream

public MultiValueTokenStream(String fieldName,
                             String[] values,
                             Analyzer analyzer,
                             boolean orderTokenOffsets)
Constructs a TokenStream for consecutively-analyzed field values

Parameters:
fieldName - name of the field
values - array of field data
analyzer - analyzer instance
Method Detail

next

public Token next()
           throws IOException
Returns the next token in the stream, or null at EOS.

Overrides:
next in class TokenStream
Throws:
IOException

asSingleValue

public String asSingleValue()
Returns all values as a single String into which the Tokens index with their offsets.



Copyright (c) 2004-2009 The Compass Project.