Class ReuseStrategy
Strategy defining how TokenStreamComponents are reused per call to GetTokenStream(String, TextReader).
Inherited Members
Namespace: Lucene.Net.Analysis
Assembly: Lucene.Net.dll
Syntax
public abstract class ReuseStrategy
Methods
| Improve this Doc View SourceGetReusableComponents(Analyzer, String)
Gets the reusable TokenStreamComponents for the field with the given name.
Declaration
public abstract TokenStreamComponents GetReusableComponents(Analyzer analyzer, string fieldName)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | analyzer | Analyzer from which to get the reused components. Use GetStoredValue(Analyzer) and SetStoredValue(Analyzer, Object) to access the data on the Analyzer. |
System.String | fieldName | Name of the field whose reusable TokenStreamComponents are to be retrieved |
Returns
Type | Description |
---|---|
TokenStreamComponents | Reusable TokenStreamComponents for the field, or |
GetStoredValue(Analyzer)
Returns the currently stored value.
Declaration
protected object GetStoredValue(Analyzer analyzer)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | analyzer |
Returns
Type | Description |
---|---|
System.Object | Currently stored value or |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | if the Analyzer is closed. |
SetReusableComponents(Analyzer, String, TokenStreamComponents)
Stores the given TokenStreamComponents as the reusable components for the field with the give name.
Declaration
public abstract void SetReusableComponents(Analyzer analyzer, string fieldName, TokenStreamComponents components)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | analyzer | Analyzer |
System.String | fieldName | Name of the field whose TokenStreamComponents are being set |
TokenStreamComponents | components | TokenStreamComponents which are to be reused for the field |
SetStoredValue(Analyzer, Object)
Sets the stored value.
Declaration
protected void SetStoredValue(Analyzer analyzer, object storedValue)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | analyzer | Analyzer |
System.Object | storedValue | Value to store |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | if the Analyzer is closed. |