Package org.apache.lucene.analysis
Class Analyzer.ReuseStrategy
- java.lang.Object
- 
- org.apache.lucene.analysis.Analyzer.ReuseStrategy
 
- 
- Enclosing class:
- Analyzer
 
 public abstract static class Analyzer.ReuseStrategy extends Object Strategy defining how TokenStreamComponents are reused per call toAnalyzer.tokenStream(String, java.io.Reader).
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedReuseStrategy()Sole constructor.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Analyzer.TokenStreamComponentsgetReusableComponents(Analyzer analyzer, String fieldName)Gets the reusable TokenStreamComponents for the field with the given name.protected ObjectgetStoredValue(Analyzer analyzer)Returns the currently stored value.abstract voidsetReusableComponents(Analyzer analyzer, String fieldName, Analyzer.TokenStreamComponents components)Stores the given TokenStreamComponents as the reusable components for the field with the give name.protected voidsetStoredValue(Analyzer analyzer, Object storedValue)Sets the stored value.
 
- 
- 
- 
Method Detail- 
getReusableComponentspublic 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. Use- getStoredValue(Analyzer)and- setStoredValue(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
 
 - 
setReusableComponentspublic 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 set
- components- TokenStreamComponents which are to be reused for the field
 
 - 
getStoredValueprotected final Object getStoredValue(Analyzer analyzer) Returns the currently stored value.- Returns:
- Currently stored value or nullif no value is stored
- Throws:
- AlreadyClosedException- if the Analyzer is closed.
 
 - 
setStoredValueprotected final void setStoredValue(Analyzer analyzer, Object storedValue) Sets the stored value.- Parameters:
- storedValue- Value to store
- Throws:
- AlreadyClosedException- if the Analyzer is closed.
 
 
- 
 
-