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
GetReusableComponents(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. |
| 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 static object GetStoredValue(Analyzer analyzer)
Parameters
| Type | Name | Description |
|---|---|---|
| Analyzer | analyzer |
Returns
| Type | Description |
|---|---|
| object | Currently stored value or |
Exceptions
| Type | Condition |
|---|---|
| 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 |
| 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 static void SetStoredValue(Analyzer analyzer, object storedValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Analyzer | analyzer | Analyzer |
| object | storedValue | Value to store |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | if the Analyzer is closed. |