public abstract static class Analyzer.ReuseStrategy extends Object
Analyzer.tokenStream(String, java.io.Reader)
.Constructor and Description |
---|
ReuseStrategy()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract Analyzer.TokenStreamComponents |
getReusableComponents(Analyzer analyzer,
String fieldName)
Gets the reusable TokenStreamComponents for the field with the given name.
|
protected Object |
getStoredValue(Analyzer analyzer)
Returns the currently stored value.
|
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.
|
protected void |
setStoredValue(Analyzer analyzer,
Object storedValue)
Sets the stored value.
|
public ReuseStrategy()
public abstract Analyzer.TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName)
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 retrievednull
if there was no previous components for the fieldpublic abstract void setReusableComponents(Analyzer analyzer, String fieldName, Analyzer.TokenStreamComponents components)
fieldName
- Name of the field whose TokenStreamComponents are being setcomponents
- TokenStreamComponents which are to be reused for the fieldprotected final Object getStoredValue(Analyzer analyzer)
null
if no value is storedAlreadyClosedException
- if the Analyzer is closed.protected final void setStoredValue(Analyzer analyzer, Object storedValue)
storedValue
- Value to storeAlreadyClosedException
- if the Analyzer is closed.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.