Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » analysis » [javadoc | source]
org.apache.lucene.analysis
abstract public class: BaseCharFilter [javadoc | source]
java.lang.Object
   java.io.Reader
      org.apache.lucene.analysis.CharStream
         org.apache.lucene.analysis.CharFilter
            org.apache.lucene.analysis.BaseCharFilter

All Implemented Interfaces:
    Closeable, Readable

Direct Known Subclasses:
    MappingCharFilter

Base utility class for implementing a CharFilter . You subclass this, and then record mappings by calling #addOffCorrectMap , and then invoke the correct method to correct an offset.

NOTE: This class is not particularly efficient. For example, a new class instance is created for every call to #addOffCorrectMap , which is then appended to a private list.
Nested Class Summary:
static class  BaseCharFilter.OffCorrectMap   
Fields inherited from org.apache.lucene.analysis.CharFilter:
input
Fields inherited from java.io.Reader:
lock
Constructor:
 public BaseCharFilter(CharStream in) 
Method from org.apache.lucene.analysis.BaseCharFilter Summary:
addOffCorrectMap,   correct,   getLastCumulativeDiff
Methods from org.apache.lucene.analysis.CharFilter:
close,   correct,   correctOffset,   mark,   markSupported,   read,   reset
Methods from org.apache.lucene.analysis.CharStream:
correctOffset
Methods from java.io.Reader:
close,   mark,   markSupported,   read,   read,   read,   read,   ready,   reset,   skip
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.analysis.BaseCharFilter Detail:
 protected  void addOffCorrectMap(int off,
    int cumulativeDiff) 
 protected int correct(int currentOff) 
    Retrieve the corrected offset. Note that this method is slow, if you correct positions far before the most recently added position, as it's a simple linear search backwards through all offset corrections added by #addOffCorrectMap .
 protected int getLastCumulativeDiff()