org.apache.lucene.analysis
Class CharFilter
java.lang.Object
java.io.Reader
java.io.FilterReader
org.apache.lucene.analysis.CharFilter
- All Implemented Interfaces:
- Closeable, Readable
public abstract class CharFilter
- extends FilterReader
Subclasses of CharFilter can be chained to filter a Reader
They can be used as Reader
with additional offset
correction. Tokenizer
s will automatically use correctOffset(int)
if a CharFilter subclass is used.
Constructor Summary |
CharFilter(Reader in)
Create a new CharFilter wrapping the provided reader. |
Method Summary |
protected abstract int |
correct(int currentOff)
Subclasses override to correct the current offset. |
int |
correctOffset(int currentOff)
Chains the corrected offset through the input
CharFilter(s). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CharFilter
public CharFilter(Reader in)
- Create a new CharFilter wrapping the provided reader.
- Parameters:
in
- a Reader, can also be a CharFilter for chaining.
correct
protected abstract int correct(int currentOff)
- Subclasses override to correct the current offset.
- Parameters:
currentOff
- current offset
- Returns:
- corrected offset
correctOffset
public final int correctOffset(int currentOff)
- Chains the corrected offset through the input
CharFilter(s).
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.