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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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. More...
virtual | ~FastCharStream ()
virtual String | getClassName ()
boost::shared_ptr< FastCharStream > | shared_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. More...
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. More...
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. More...
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. More...
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. 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. More...
virtual int32_t | getColumn ()
| Returns the column position of the character last read. More...
virtual int32_t | getLine ()
| Returns the line number of the character last read. More...
virtual int32_t | getEndColumn ()
| Returns the column number of the last character for current token (being matched after the last call to BeginToken). More...
virtual int32_t | getEndLine ()
| Returns the line number of the last character for current token (being matched after the last call to BeginToken). More...
virtual int32_t | getBeginColumn ()
| Returns the column number of the first character for current token (being matched after the last call to BeginToken). More...
virtual int32_t | getBeginLine ()
| Returns the line number of the first character for current token (being matched after the last call to BeginToken). More...
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. More...
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## 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

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

Constructs from a Reader.

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

virtual

## Member Function Documentation

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

inline static

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.

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.

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.

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.

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.

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

inline virtual

Reimplemented from Lucene::QueryParserCharStream.

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

virtual

Returns the column position of the character last read.

Deprecated:
  See also
    getEndColumn

Implements Lucene::QueryParserCharStream.

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.

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.

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.

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

virtual

Returns the line number of the character last read.

Deprecated:
  See also
    getEndLine

Implements Lucene::QueryParserCharStream.

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.

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.

void Lucene::FastCharStream::refill | ( |  | ) |

protected

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

inline

## Field Documentation

CharArray Lucene::FastCharStream::buffer

int32_t Lucene::FastCharStream::bufferLength

int32_t Lucene::FastCharStream::bufferPosition

int32_t Lucene::FastCharStream::bufferStart

ReaderPtr Lucene::FastCharStream::input

int32_t Lucene::FastCharStream::tokenStart

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

- FastCharStream.h

clucene.sourceforge.net