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
파일 보기 프로젝트 열기: apache/lucenenet

공개 프로퍼티들

프로퍼티 타입 설명
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