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
Afficher le fichier Open project: apache/lucenenet

Méthodes publiques

Свойство Type Description
input System.IO.TextReader

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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.
Résultat System

Close() public méthode

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
Résultat void

Correct() protected abstract méthode

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

CorrectOffset() public méthode

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

Mark() public méthode

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.
Résultat void

Ready() public méthode

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
Résultat bool

Reset() public méthode

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

Skip() public méthode

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
Résultat long

Property Details

input public_oe property

The underlying character-input stream.
public TextReader,System.IO input
Résultat System.IO.TextReader