public final class

CharReader

extends CharStream
java.lang.Object
   ↳ java.io.Reader
     ↳ org.apache.lucene.analysis.CharStream
       ↳ org.apache.lucene.analysis.CharReader

Class Overview

CharReader is a Reader wrapper. It reads chars from Reader and outputs CharStream, defining an identify function correctOffset(int) method that simply returns the provided offset.

Summary

Fields
protected Reader input
[Expand]
Inherited Fields
From class java.io.Reader
Public Methods
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()
[Expand]
Inherited Methods
From class org.apache.lucene.analysis.CharStream
From class java.io.Reader
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.Readable

Fields

protected Reader input

Public Methods

public void close ()

Throws
IOException

public int correctOffset (int currentOff)

Called by CharFilter(s) and Tokenizer to correct token offset.

Parameters
currentOff offset as seen in the output
Returns
  • corrected offset based on the input

public static CharStream get (Reader input)

public void mark (int readAheadLimit)

Throws
IOException

public boolean markSupported ()

public int read (char[] cbuf, int off, int len)

Throws
IOException

public void reset ()

Throws
IOException