C# Класс 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.

Наследование: System.IO.TextReader
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
input System.IO.TextReader

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
CharFilter ( TextReader input ) : System

Create a new CharFilter wrapping the provided reader.

Correct ( int currentOff ) : int

Subclasses override to correct the current offset.

Описание методов

CharFilter() защищенный Метод

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.
Результат System

Close() публичный Метод

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
Результат void

Correct() защищенный абстрактный Метод

Subclasses override to correct the current offset.
protected abstract Correct ( int currentOff ) : int
currentOff int current offset
Результат int

CorrectOffset() публичный Метод

Chains the corrected offset through the input CharFilter(s).
public CorrectOffset ( int currentOff ) : int
currentOff int
Результат int

Mark() публичный Метод

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.
Результат void

Ready() публичный Метод

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
Результат bool

Reset() публичный Метод

LUCENENET specific. Moved here from the Java Reader class so it can be overridden to provide reader buffering.
public Reset ( ) : void
Результат void

Skip() публичный Метод

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
Результат long

Описание свойств

input публичное свойство

The underlying character-input stream.
public TextReader,System.IO input
Результат System.IO.TextReader