Package org.apache.lucene.tests.analysis
Class MockCharFilter
- java.lang.Object
-
- java.io.Reader
-
- org.apache.lucene.analysis.CharFilter
-
- org.apache.lucene.tests.analysis.MockCharFilter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,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 org.apache.lucene.analysis.CharFilter
input
-
-
Constructor Summary
Constructors Constructor Description MockCharFilter(Reader in)
MockCharFilter(Reader in, int remainder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addOffCorrectMap(int off, int cumulativeDiff)
int
correct(int currentOff)
int
read()
int
read(char[] cbuf, int off, int len)
-
Methods inherited from class org.apache.lucene.analysis.CharFilter
close, correctOffset
-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
-
-
-
-
Method Detail
-
read
public int read() throws IOException
- Overrides:
read
in classReader
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Specified by:
read
in classReader
- Throws:
IOException
-
correct
public int correct(int currentOff)
- Specified by:
correct
in classCharFilter
-
addOffCorrectMap
protected void addOffCorrectMap(int off, int cumulativeDiff)
-
-