org.apache.lucene.analysis
Class CachingTokenFilter
- java.lang.Object
-
- org.apache.lucene.analysis.TokenStream
-
- org.apache.lucene.analysis.TokenFilter
-
- org.apache.lucene.analysis.CachingTokenFilter
-
public class CachingTokenFilter extends TokenFilter
This class can be used if the Tokens of a TokenStream are intended to be consumed more than once. It caches all Tokens locally in a List. CachingTokenFilter implements the optional methodTokenStream.reset(), which repositions the stream to the first Token.
-
-
Constructor Summary
Constructors Constructor and Description CachingTokenFilter(TokenStream input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Tokennext()Returns the next token in the stream, or null at EOS.voidreset()Resets this stream to the beginning.-
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close
-
Methods inherited from class org.apache.lucene.analysis.TokenStream
next
-
-
-
-
Constructor Detail
-
CachingTokenFilter
public CachingTokenFilter(TokenStream input)
-
-
Method Detail
-
next
public Token next() throws java.io.IOException
Description copied from class:TokenStreamReturns the next token in the stream, or null at EOS. The returned Token is a "full private copy" (not re-used across calls to next()) but will be slower than callingTokenStream.next(Token)instead..- Overrides:
nextin classTokenStream- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOExceptionDescription copied from class:TokenStreamResets this stream to the beginning. This is an optional operation, so subclasses may or may not implement this method. Reset() is not needed for the standard indexing process. However, if the Tokens of a TokenStream are intended to be consumed more than once, it is necessary to implement reset().- Overrides:
resetin classTokenStream- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG