C# Class Lucene.Net.Analysis.CharFilter

Subclasses of CharFilter can be chained to filter a Reader They can be used as java.io.Reader with additional offset correction. Tokenizers will automatically use #correctOffset if a CharFilter subclass is used.

this class is abstract: at a minimum you must implement #read(char[], int, int), transforming the input in some way from #input, and #correct(int) to adjust the offsets to match the originals.

You can optionally provide more efficient implementations of additional methods like #read(), #read(char[]), #read(java.nio.CharBuffer), but this is not required.

For examples and integration with Analyzer, see the Lucene.Net.Analysis Analysis package documentation.

Inheritance: System.IO.TextReader
Mostra file Open project: apache/lucenenet

Public Properties

Property Type Description
input System.IO.TextReader

Public Methods

Method Description
Close ( ) : void

Closes the underlying input stream.

NOTE: The default implementation closes the input Reader, so be sure to call super.close() when overriding this method.

CorrectOffset ( int currentOff ) : int

Chains the corrected offset through the input CharFilter(s).

Mark ( int readAheadLimit ) : void

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() operation. LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.

Ready ( ) : bool

Tells whether this stream is ready to be read. True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block. LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.

Reset ( ) : void

LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.

Skip ( int n ) : long

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 Java Reader class so it can be overridden to provide reader buffering.

Protected Methods

Method Description
CharFilter ( TextReader input ) : System

Create a new CharFilter wrapping the provided reader.

Correct ( int currentOff ) : int

Subclasses override to correct the current offset.

Method Details

CharFilter() protected method

Create a new CharFilter wrapping the provided reader.
protected CharFilter ( TextReader input ) : System
input System.IO.TextReader a Reader, can also be a CharFilter for chaining.
return System

Close() public method

Closes the underlying input stream.

NOTE: The default implementation closes the input Reader, so be sure to call super.close() when overriding this method.

public Close ( ) : void
return void

Correct() protected abstract method

Subclasses override to correct the current offset.
protected abstract Correct ( int currentOff ) : int
currentOff int current offset
return int

CorrectOffset() public method

Chains the corrected offset through the input CharFilter(s).
public CorrectOffset ( int currentOff ) : int
currentOff int
return int

Mark() public method

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() operation. LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.
public Mark ( int readAheadLimit ) : void
readAheadLimit int 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.
return void

Ready() public method

Tells whether this stream is ready to be read. True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block. LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.
public Ready ( ) : bool
return bool

Reset() public method

LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.
public Reset ( ) : void
return void

Skip() public method

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 Java Reader class so it can be overridden to provide reader buffering.
public Skip ( int n ) : long
n int The number of characters to skip
return long

Property Details

input public_oe property

The underlying character-input stream.
public TextReader,System.IO input
return System.IO.TextReader