Class CharFilter
Subclasses of CharFilter can be chained to filter a
This class is abstract: at a minimum you must implement
You can optionally provide more efficient implementations of additional methods
like
For examples and integration with Analyzer, see the Lucene.Net.Analysis namespace documentation.
Inheritance
Namespace: Lucene.Net.Analysis
Assembly: Lucene.Net.dll
Syntax
public abstract class CharFilter : TextReader
Constructors
| Improve this Doc View SourceCharFilter(TextReader)
Create a new CharFilter wrapping the provided reader.
Declaration
public CharFilter(TextReader input)
Parameters
Type | Name | Description |
---|---|---|
TextReader | input | a |
Fields
| Improve this Doc View Sourcem_input
The underlying character-input stream.
Declaration
protected readonly TextReader m_input
Field Value
Type | Description |
---|---|
TextReader |
Properties
| Improve this Doc View SourceIsMarkSupported
Tells whether this stream supports the Mark(Int32) operation. The default implementation always returns false. Subclasses should override this method.
LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.
Declaration
public virtual bool IsMarkSupported { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if and only if this stream supports the mark operation. |
IsReady
Tells whether this stream is ready to be read.
True if the next
LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.
Declaration
public virtual bool IsReady { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceCorrect(Int32)
Subclasses override to correct the current offset.
Declaration
protected abstract int Correct(int currentOff)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | currentOff | current offset |
Returns
Type | Description |
---|---|
System.Int32 | corrected offset |
CorrectOffset(Int32)
Chains the corrected offset through the input CharFilter(s).
Declaration
public int CorrectOffset(int currentOff)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | currentOff |
Returns
Type | Description |
---|---|
System.Int32 |
Dispose(Boolean)
Closes the underlying input stream.
NOTE:
The default implementation closes the input base.Dispose(disposing)
when overriding this method.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Mark(Int32)
Marks the present position in the stream. Subsequent calls to Reset() will attempt to reposition the stream to this point. Not all character-input streams support the Mark(Int32) operation.
LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.
Declaration
public virtual void Mark(int readAheadLimit)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | readAheadLimit | Limit on the number of characters that may be read while still preserving the mark. After reading this many characters, attempting to reset the stream may fail. |
Read()
Declaration
public override int Read()
Returns
Type | Description |
---|---|
System.Int32 |
Read(Char[], Int32, Int32)
Declaration
public abstract override int Read(char[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Char[] | buffer | |
System.Int32 | index | |
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Int32 |
Reset()
LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.
Declaration
public virtual void Reset()
Skip(Int32)
Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached.
LUCENENET specific. Moved here from the Reader class (in Java) so it can be overridden to provide reader buffering.
Declaration
public virtual long Skip(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n | The number of characters to skip |
Returns
Type | Description |
---|---|
System.Int64 | The number of characters actually skipped |