org.apache.jackrabbit.core.query.lucene
Class SingletonTokenStream

java.lang.Object
  extended by org.apache.lucene.util.AttributeSource
      extended by org.apache.lucene.analysis.TokenStream
          extended by org.apache.jackrabbit.core.query.lucene.SingletonTokenStream
All Implemented Interfaces:
Closeable

public final class SingletonTokenStream
extends org.apache.lucene.analysis.TokenStream

SingletonTokenStream implements a token stream that wraps a single value with a given property type. The property type is stored as a payload on the single returned token.


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
SingletonTokenStream(String value, int type)
          Creates a new SingleTokenStream with the given value and a property type.
SingletonTokenStream(String value, org.apache.lucene.index.Payload payload)
          Creates a new SingleTokenStream with the given value and payload.
 
Method Summary
 void close()
          
 boolean incrementToken()
           
 void reset()
          
 
Methods inherited from class org.apache.lucene.analysis.TokenStream
end
 
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

SingletonTokenStream

public SingletonTokenStream(String value,
                            org.apache.lucene.index.Payload payload)
Creates a new SingleTokenStream with the given value and payload.

Parameters:
value - the string value that will be returned with the token.
payload - the payload that will be attached to this token

SingletonTokenStream

public SingletonTokenStream(String value,
                            int type)
Creates a new SingleTokenStream with the given value and a property type.

Parameters:
value - the string value that will be returned with the token.
type - the JCR property type.
Method Detail

incrementToken

public boolean incrementToken()
                       throws IOException
Specified by:
incrementToken in class org.apache.lucene.analysis.TokenStream
Throws:
IOException

reset

public void reset()
           throws IOException

Overrides:
reset in class org.apache.lucene.analysis.TokenStream
Throws:
IOException

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class org.apache.lucene.analysis.TokenStream
Throws:
IOException


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