org.apache.lucene.analysis.standard

Class FastCharStream

Implemented Interfaces:
CharStream

public final class FastCharStream
extends java.lang.Object
implements CharStream

An efficient implementation of JavaCC's CharStream interface.

Note that this does not do line-number counting, but instead keeps track of the character position of the token in the input, as required by Lucene's Token API.

Constructor Summary

FastCharStream(Reader r)
Constructs from a Reader.

Method Summary

char
BeginToken()
void
Done()
String
GetImage()
char[]
GetSuffix(int len)
void
backup(int amount)
int
getBeginColumn()
int
getBeginLine()
int
getColumn()
int
getEndColumn()
int
getEndLine()
int
getLine()
char
readChar()

Constructor Details

FastCharStream

public FastCharStream(Reader r)
Constructs from a Reader.

Method Details

BeginToken

public final char BeginToken()
            throws IOException
Specified by:
BeginToken in interface CharStream


Done

public final void Done()
Specified by:
Done in interface CharStream


GetImage

public final String GetImage()
Specified by:
GetImage in interface CharStream


GetSuffix

public final char[] GetSuffix(int len)
Specified by:
GetSuffix in interface CharStream


backup

public final void backup(int amount)
Specified by:
backup in interface CharStream


getBeginColumn

public final int getBeginColumn()
Specified by:
getBeginColumn in interface CharStream


getBeginLine

public final int getBeginLine()
Specified by:
getBeginLine in interface CharStream


getColumn

public final int getColumn()
Specified by:
getColumn in interface CharStream


getEndColumn

public final int getEndColumn()
Specified by:
getEndColumn in interface CharStream


getEndLine

public final int getEndLine()
Specified by:
getEndLine in interface CharStream


getLine

public final int getLine()
Specified by:
getLine in interface CharStream


readChar

public final char readChar()
            throws IOException
Specified by:
readChar in interface CharStream


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