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


Loading...
Searching...
No Matches
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< Attributeshared_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.
 
virtual int32_t hashCode ()=0
 Subclasses must implement this method and should compute a hashCode similar to this:
 
virtual bool equals (const LuceneObjectPtr &other)=0
 All values used for computation of hashCode() should be checked here for equality.
 
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.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())=0
 Shallow clone. Subclasses must override this if they need to clone any members deeply.
 
- 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 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 ()
 

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 ( )
inlinestatic

◆ 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::FlagsAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::PositionIncrementAttribute, Lucene::TermAttribute, Lucene::Token, 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
baseclone reference - null when called initially, then set in top virtual override.

Reimplemented from Lucene::LuceneObject.

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

◆ 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::FlagsAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::PositionIncrementAttribute, Lucene::TermAttribute, Lucene::Token, and Lucene::TypeAttribute.

◆ equals()

virtual bool Lucene::Attribute::equals ( const LuceneObjectPtr other)
pure virtual

◆ getClassName()

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

◆ 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::FlagsAttribute, Lucene::OffsetAttribute, Lucene::PayloadAttribute, Lucene::PositionIncrementAttribute, Lucene::TermAttribute, Lucene::Token, 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:

clucene.sourceforge.net