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

Public Member Functions | Static Public Member Functions
Lucene::Attribute Class Referenceabstract

Base class for Attributes that can be added to a AttributeSource. More...

`#include <Attribute.h>`

Inheritance diagram for Lucene::Attribute:

## Public Member Functions

virtual | ~Attribute ()
virtual String | getClassName ()
boost::shared_ptr< Attribute > | shared_from_this ()
virtual void | clear ()=0
| Clears the values in this Attribute and resets it to its default value. If this implementation implements more than one Attribute interface it clears all. More...
virtual int32_t | hashCode ()=0
| Subclasses must implement this method and should compute a hashCode similar to this: More...
virtual bool | equals (const LuceneObjectPtr &other)=0
| All values used for computation of hashCode() should be checked here for equality. More...
virtual void | copyTo (const AttributePtr &target)=0
| Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports. More...
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())=0
| Shallow clone. Subclasses must override this if they need to clone any members deeply. 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 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 ()

## Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Detailed Description

Base class for Attributes that can be added to a AttributeSource.

Attributes are used to add data in a dynamic, yet type-safe way to a source of usually streamed objects, eg. a TokenStream.

## Constructor & Destructor Documentation

## ◆ ~Attribute()

virtual Lucene::Attribute::~Attribute | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

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

inline static

## ◆ clear()

virtual void Lucene::Attribute::clear | ( |  | ) |

pure virtual

Clears the values in this Attribute and resets it to its default value. If this implementation implements more than one Attribute interface it clears all.

Implemented in Lucene::Token, Lucene::TermAttribute, Lucene::PositionIncrementAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::FlagsAttribute, and Lucene::TypeAttribute.

## ◆ clone()

virtual LuceneObjectPtr Lucene::Attribute::clone | ( | const LuceneObjectPtr & | other = `LuceneObjectPtr()` | ) |

pure virtual

Shallow clone. Subclasses must override this if they need to clone any members deeply.

Parameters

  base | clone reference - null when called initially, then set in top virtual override.

Reimplemented from Lucene::LuceneObject.

Implemented in Lucene::Token, Lucene::TermAttribute, Lucene::PositionIncrementAttribute, Lucene::OffsetAttribute, Lucene::FlagsAttribute, Lucene::TypeAttribute, and Lucene::PayloadAttribute.

## ◆ copyTo()

virtual void Lucene::Attribute::copyTo | ( | const AttributePtr & | target | ) |

pure virtual

Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.

Implemented in Lucene::Token, Lucene::TermAttribute, Lucene::PositionIncrementAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::FlagsAttribute, and Lucene::TypeAttribute.

## ◆ equals()

virtual bool Lucene::Attribute::equals | ( | const LuceneObjectPtr & | other | ) |

pure virtual

All values used for computation of hashCode() should be checked here for equality.

see also LuceneObject#equals(Object)

Reimplemented from Lucene::LuceneObject.

Implemented in Lucene::Token, Lucene::TermAttribute, Lucene::PositionIncrementAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::FlagsAttribute, and Lucene::TypeAttribute.

## ◆ getClassName()

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

inline virtual

Reimplemented in Lucene::Token, Lucene::PositionIncrementAttribute, Lucene::PayloadAttribute, Lucene::FlagsAttribute, Lucene::TypeAttribute, Lucene::OffsetAttribute, and Lucene::TermAttribute.

## ◆ hashCode()

virtual int32_t Lucene::Attribute::hashCode | ( |  | ) |

pure virtual

Subclasses must implement this method and should compute a hashCode similar to this:

int32_t hashCode() { int32_t code = startOffset; code = code * 31 + endOffset; return code; }

see also equals(Object)

Reimplemented from Lucene::LuceneObject.

Implemented in Lucene::Token, Lucene::TermAttribute, Lucene::PositionIncrementAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::FlagsAttribute, and Lucene::TypeAttribute.

## ◆ shared_from_this()

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

inline

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

- Attribute.h

clucene.sourceforge.net