Lucene++ - a full-featured, c++ search engine
API Documentation


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
Lucene::FastCharStream Class Reference

An efficient implementation of QueryParserCharStream interface. More...

#include <FastCharStream.h>

+ Inheritance diagram for Lucene::FastCharStream:

Public Member Functions

 FastCharStream (const ReaderPtr &reader)
 Constructs from a Reader.
 
virtual ~FastCharStream ()
 
virtual String getClassName ()
 
boost::shared_ptr< FastCharStreamshared_from_this ()
 
virtual wchar_t readChar ()
 Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this interface.
 
virtual wchar_t 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.
 
virtual void backup (int32_t 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 implementation's's responsibility to do this right.
 
virtual String GetImage ()
 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.
 
virtual CharArray GetSuffix (int32_t length)
 Returns an array of characters that make up the suffix of length for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE.
 
virtual 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.
 
virtual int32_t getColumn ()
 Returns the column position of the character last read.
 
virtual int32_t getLine ()
 Returns the line number of the character last read.
 
virtual int32_t getEndColumn ()
 Returns the column number of the last character for current token (being matched after the last call to BeginToken).
 
virtual int32_t getEndLine ()
 Returns the line number of the last character for current token (being matched after the last call to BeginToken).
 
virtual int32_t getBeginColumn ()
 Returns the column number of the first character for current token (being matched after the last call to BeginToken).
 
virtual int32_t getBeginLine ()
 Returns the line number of the first character for current token (being matched after the last call to BeginToken).
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 
- Static Public Member Functions inherited from Lucene::QueryParserCharStream
static String _getClassName ()
 

Data Fields

CharArray buffer
 
int32_t bufferLength
 
int32_t bufferPosition
 
int32_t tokenStart
 
int32_t bufferStart
 
ReaderPtr input
 

Protected Member Functions

void refill ()
 
- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Additional Inherited Members

- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

An efficient implementation of QueryParserCharStream 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 & Destructor Documentation

◆ FastCharStream()

Lucene::FastCharStream::FastCharStream ( const ReaderPtr reader)

Constructs from a Reader.

◆ ~FastCharStream()

virtual Lucene::FastCharStream::~FastCharStream ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::FastCharStream::_getClassName ( )
inlinestatic

◆ backup()

virtual void Lucene::FastCharStream::backup ( int32_t  amount)
virtual

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 implementation's's responsibility to do this right.

Implements Lucene::QueryParserCharStream.

◆ BeginToken()

virtual wchar_t Lucene::FastCharStream::BeginToken ( )
virtual

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::QueryParserCharStream.

◆ Done()

virtual void Lucene::FastCharStream::Done ( )
virtual

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::QueryParserCharStream.

◆ getBeginColumn()

virtual int32_t Lucene::FastCharStream::getBeginColumn ( )
virtual

Returns the column number of the first character for current token (being matched after the last call to BeginToken).

Implements Lucene::QueryParserCharStream.

◆ getBeginLine()

virtual int32_t Lucene::FastCharStream::getBeginLine ( )
virtual

Returns the line number of the first character for current token (being matched after the last call to BeginToken).

Implements Lucene::QueryParserCharStream.

◆ getClassName()

virtual String Lucene::FastCharStream::getClassName ( )
inlinevirtual

Reimplemented from Lucene::QueryParserCharStream.

◆ getColumn()

virtual int32_t Lucene::FastCharStream::getColumn ( )
virtual

Returns the column position of the character last read.

Deprecated:
See also
getEndColumn

Implements Lucene::QueryParserCharStream.

◆ getEndColumn()

virtual int32_t Lucene::FastCharStream::getEndColumn ( )
virtual

Returns the column number of the last character for current token (being matched after the last call to BeginToken).

Implements Lucene::QueryParserCharStream.

◆ getEndLine()

virtual int32_t Lucene::FastCharStream::getEndLine ( )
virtual

Returns the line number of the last character for current token (being matched after the last call to BeginToken).

Implements Lucene::QueryParserCharStream.

◆ GetImage()

virtual String Lucene::FastCharStream::GetImage ( )
virtual

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.

Implements Lucene::QueryParserCharStream.

◆ getLine()

virtual int32_t Lucene::FastCharStream::getLine ( )
virtual

Returns the line number of the character last read.

Deprecated:
See also
getEndLine

Implements Lucene::QueryParserCharStream.

◆ GetSuffix()

virtual CharArray Lucene::FastCharStream::GetSuffix ( int32_t  length)
virtual

Returns an array of characters that make up the suffix of length for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE.

Implements Lucene::QueryParserCharStream.

◆ readChar()

virtual wchar_t Lucene::FastCharStream::readChar ( )
virtual

Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this interface.

Implements Lucene::QueryParserCharStream.

◆ refill()

void Lucene::FastCharStream::refill ( )
protected

◆ shared_from_this()

boost::shared_ptr< FastCharStream > Lucene::FastCharStream::shared_from_this ( )
inline

Field Documentation

◆ buffer

CharArray Lucene::FastCharStream::buffer

◆ bufferLength

int32_t Lucene::FastCharStream::bufferLength

◆ bufferPosition

int32_t Lucene::FastCharStream::bufferPosition

◆ bufferStart

int32_t Lucene::FastCharStream::bufferStart

◆ input

ReaderPtr Lucene::FastCharStream::input

◆ tokenStart

int32_t Lucene::FastCharStream::tokenStart

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

clucene.sourceforge.net