Package org.apache.lucene.analysis
Class Analyzer.ReuseStrategy
java.lang.Object
org.apache.lucene.analysis.Analyzer.ReuseStrategy
- Direct Known Subclasses:
Analyzer.GlobalReuseStrategy,Analyzer.PerFieldReuseStrategy
- Enclosing class:
Analyzer
Strategy defining how TokenStreamComponents are reused per call to
Analyzer.tokenStream(String, java.io.Reader).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Analyzer.TokenStreamComponentsgetReusableComponents(Analyzer analyzer, String fieldName) Gets the reusable TokenStreamComponents for the field with the given name.abstract voidsetReusableComponents(Analyzer analyzer, String fieldName, Analyzer.TokenStreamComponents components) Stores the given TokenStreamComponents as the reusable components for the field with the give name.
-
Constructor Details
-
ReuseStrategy
public ReuseStrategy()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
getReusableComponents
public abstract Analyzer.TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) Gets the reusable TokenStreamComponents for the field with the given name.- Parameters:
analyzer- Analyzer from which to get the reused components. UsegetStoredValue(Analyzer)andsetStoredValue(Analyzer, Object)to access the data on the Analyzer.fieldName- Name of the field whose reusable TokenStreamComponents are to be retrieved- Returns:
- Reusable TokenStreamComponents for the field, or
nullif there was no previous components for the field
-
setReusableComponents
public abstract void setReusableComponents(Analyzer analyzer, String fieldName, Analyzer.TokenStreamComponents components) Stores the given TokenStreamComponents as the reusable components for the field with the give name.- Parameters:
fieldName- Name of the field whose TokenStreamComponents are being setcomponents- TokenStreamComponents which are to be reused for the field
-