Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Properties | List of all members
Lucene.Net.QueryParsers.FastCharStream Class Reference

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 Lucene.Net.Analysis.Token API. More...

Inherits Lucene.Net.QueryParsers.ICharStream.

Public Member Functions

 FastCharStream (System.IO.TextReader r)
 Constructs from a Reader.
 
char ReadChar ()
 Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this interface. Can throw any java.io.IOException.
 
char BeginToken ()
 Returns the next character that marks the beginning of the next token. All characters must remain in the buffer between two successive calls to this method to implement backup correctly.
 
void Backup (int amount)
 Backs up the input stream by amount steps. Lexer calls this method if it had already read some characters, but could not use them to match a (longer) token. So, they will be used again as the prefix of the next token and it is the implemetation's responsibility to do this right.
 
char[] GetSuffix (int len)
 Returns an array of characters that make up the suffix of length 'len' for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE. A simple and inefficient implementation of this is as follows :
 
void Done ()
 The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class. Again, the body of this function can be just empty and it will not affect the lexer's operation.
 

Properties

string Image [get]
 
int Column [get]
 
int Line [get]
 
int EndColumn [get]
 
int EndLine [get]
 
int BeginColumn [get]
 
int BeginLine [get]
 
- Properties inherited from Lucene.Net.QueryParsers.ICharStream
int Column [get]
 Returns the column position of the character last read.
 
int Line [get]
 Returns the line number of the character last read.
 
int EndColumn [get]
 Returns the column number of the last character for current token (being matched after the last call to BeginTOken).
 
int EndLine [get]
 Returns the line number of the last character for current token (being matched after the last call to BeginTOken).
 
int BeginColumn [get]
 Returns the column number of the first character for current token (being matched after the last call to BeginTOken).
 
int BeginLine [get]
 Returns the line number of the first character for current token (being matched after the last call to BeginTOken).
 
string Image [get]
 Returns a string made up of characters from the marked token beginning to the current buffer position. Implementations have the choice of returning anything that they want to. For example, for efficiency, one might decide to just return null, which is a valid implementation.
 

Detailed Description

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 Lucene.Net.Analysis.Token API.

Definition at line 31 of file FastCharStream.cs.

Constructor & Destructor Documentation

Lucene.Net.QueryParsers.FastCharStream.FastCharStream ( System.IO.TextReader  r)

Constructs from a Reader.

Definition at line 44 of file FastCharStream.cs.

Member Function Documentation

void Lucene.Net.QueryParsers.FastCharStream.Backup ( int  amount)

Backs up the input stream by amount steps. Lexer calls this method if it had already read some characters, but could not use them to match a (longer) token. So, they will be used again as the prefix of the next token and it is the implemetation's responsibility to do this right.

Implements Lucene.Net.QueryParsers.ICharStream.

Definition at line 100 of file FastCharStream.cs.

char Lucene.Net.QueryParsers.FastCharStream.BeginToken ( )

Returns the next character that marks the beginning of the next token. All characters must remain in the buffer between two successive calls to this method to implement backup correctly.

Implements Lucene.Net.QueryParsers.ICharStream.

Definition at line 94 of file FastCharStream.cs.

void Lucene.Net.QueryParsers.FastCharStream.Done ( )

The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class. Again, the body of this function can be just empty and it will not affect the lexer's operation.

Implements Lucene.Net.QueryParsers.ICharStream.

Definition at line 117 of file FastCharStream.cs.

char [] Lucene.Net.QueryParsers.FastCharStream.GetSuffix ( int  len)

Returns an array of characters that make up the suffix of length 'len' for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE. A simple and inefficient implementation of this is as follows :

{ String t = GetImage(); return t.substring(t.length() - len, t.length()).toCharArray(); }

Implements Lucene.Net.QueryParsers.ICharStream.

Definition at line 110 of file FastCharStream.cs.

char Lucene.Net.QueryParsers.FastCharStream.ReadChar ( )

Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this interface. Can throw any java.io.IOException.

Implements Lucene.Net.QueryParsers.ICharStream.

Definition at line 49 of file FastCharStream.cs.

Property Documentation

int Lucene.Net.QueryParsers.FastCharStream.BeginColumn
get

Definition at line 150 of file FastCharStream.cs.

int Lucene.Net.QueryParsers.FastCharStream.BeginLine
get

Definition at line 155 of file FastCharStream.cs.

int Lucene.Net.QueryParsers.FastCharStream.Column
get

Definition at line 130 of file FastCharStream.cs.

int Lucene.Net.QueryParsers.FastCharStream.EndColumn
get

Definition at line 140 of file FastCharStream.cs.

int Lucene.Net.QueryParsers.FastCharStream.EndLine
get

Definition at line 145 of file FastCharStream.cs.

string Lucene.Net.QueryParsers.FastCharStream.Image
get

Definition at line 106 of file FastCharStream.cs.

int Lucene.Net.QueryParsers.FastCharStream.Line
get

Definition at line 135 of file FastCharStream.cs.


The documentation for this class was generated from the following file: