Package org.apache.lucene.analysis
Class CharReader
- java.lang.Object
-
- java.io.Reader
-
- org.apache.lucene.analysis.CharStream
-
- org.apache.lucene.analysis.CharReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public final class CharReader extends CharStream
CharReader is a Reader wrapper. It reads chars from Reader and outputsCharStream
, defining an identify functioncorrectOffset(int)
method that simply returns the provided offset.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
correctOffset(int currentOff)
Called by CharFilter(s) and Tokenizer to correct token offset.static CharStream
get(Reader input)
void
mark(int readAheadLimit)
boolean
markSupported()
int
read(char[] cbuf, int off, int len)
void
reset()
-
Methods inherited from class java.io.Reader
nullReader, read, read, read, ready, skip, transferTo
-
-
-
-
Method Detail
-
get
public static CharStream get(Reader input)
-
correctOffset
public int correctOffset(int currentOff)
Description copied from class:CharStream
Called by CharFilter(s) and Tokenizer to correct token offset.- Specified by:
correctOffset
in classCharStream
- Parameters:
currentOff
- offset as seen in the output- Returns:
- corrected offset based on the input
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Specified by:
read
in classReader
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classReader
-
mark
public void mark(int readAheadLimit) throws IOException
- Overrides:
mark
in classReader
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classReader
- Throws:
IOException
-
-