public abstract class

CharFilter

extends CharStream
java.lang.Object
   ↳ java.io.Reader
     ↳ org.apache.lucene.analysis.CharStream
       ↳ org.apache.lucene.analysis.CharFilter
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Subclasses of CharFilter can be chained to filter CharStream. They can be used as Reader with additional offset correction. Tokenizers will automatically use correctOffset(int) if a CharFilter/CharStream subclass is used.

Summary

Fields
protected CharStream input
[Expand]
Inherited Fields
From class java.io.Reader
Protected Constructors
CharFilter(CharStream in)
Public Methods
void close()
final int correctOffset(int currentOff)
Chains the corrected offset through the input CharFilter.
void mark(int readAheadLimit)
boolean markSupported()
int read(char[] cbuf, int off, int len)
void reset()
Protected Methods
int correct(int currentOff)
Subclass may want to override to correct the current offset.
[Expand]
Inherited Methods
From class org.apache.lucene.analysis.CharStream
From class java.io.Reader
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.Readable

Fields

protected CharStream input

Protected Constructors

protected CharFilter (CharStream in)

Public Methods

public void close ()

Throws
IOException

public final int correctOffset (int currentOff)

Chains the corrected offset through the input CharFilter.

Parameters
currentOff offset as seen in the output
Returns
  • corrected offset based on the input

public void mark (int readAheadLimit)

Throws
IOException

public boolean markSupported ()

public int read (char[] cbuf, int off, int len)

Throws
IOException

public void reset ()

Throws
IOException

Protected Methods

protected int correct (int currentOff)

Subclass may want to override to correct the current offset.

Parameters
currentOff current offset
Returns
  • corrected offset