org.apache.lucene.analysis
Class MockCharFilter

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by org.apache.lucene.analysis.CharFilter
              extended by org.apache.lucene.analysis.MockCharFilter
All Implemented Interfaces:
Closeable, Readable

public class MockCharFilter
extends CharFilter

the purpose of this charfilter is to send offsets out of bounds if the analyzer doesn't use correctOffset or does incorrect offset math.


Field Summary
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
MockCharFilter(Reader in)
           
MockCharFilter(Reader in, int remainder)
           
 
Method Summary
protected  void addOffCorrectMap(int off, int cumulativeDiff)
           
 void close()
           
 int correct(int currentOff)
           
 int read()
           
 int read(char[] cbuf, int off, int len)
           
 
Methods inherited from class org.apache.lucene.analysis.CharFilter
correctOffset
 
Methods inherited from class java.io.FilterReader
mark, markSupported, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockCharFilter

public MockCharFilter(Reader in,
                      int remainder)

MockCharFilter

public MockCharFilter(Reader in)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterReader
Throws:
IOException

read

public int read()
         throws IOException
Overrides:
read in class FilterReader
Throws:
IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterReader
Throws:
IOException

correct

public int correct(int currentOff)
Specified by:
correct in class CharFilter

addOffCorrectMap

protected void addOffCorrectMap(int off,
                                int cumulativeDiff)


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.