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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::PayloadAttribute Class Reference

The start and end character offset of a Token. More...

#include <PayloadAttribute.h>

+ Inheritance diagram for Lucene::PayloadAttribute:

Public Member Functions

 PayloadAttribute ()
 Initialize this attribute with no payload.
 
 PayloadAttribute (const PayloadPtr &payload)
 Initialize this attribute with the given payload.
 
virtual ~PayloadAttribute ()
 
virtual String getClassName ()
 
boost::shared_ptr< PayloadAttributeshared_from_this ()
 
virtual String toString ()
 Returns a string representation of the object.
 
virtual PayloadPtr getPayload ()
 Returns this Token's payload.
 
virtual void setPayload (const PayloadPtr &payload)
 Sets this Token's payload.
 
virtual void clear ()
 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 LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Shallow clone. Subclasses must override this if they need to clone any members deeply.
 
virtual bool equals (const LuceneObjectPtr &other)
 All values used for computation of hashCode() should be checked here for equality.
 
virtual int32_t hashCode ()
 Subclasses must implement this method and should compute a hashCode similar to this:
 
virtual void copyTo (const AttributePtr &target)
 Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.
 
- Public Member Functions inherited from Lucene::Attribute
virtual ~Attribute ()
 
boost::shared_ptr< Attributeshared_from_this ()
 
- 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.
 
- 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::Attribute
static String _getClassName ()
 

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

The start and end character offset of a Token.

Constructor & Destructor Documentation

◆ PayloadAttribute() [1/2]

Lucene::PayloadAttribute::PayloadAttribute ( )

Initialize this attribute with no payload.

◆ PayloadAttribute() [2/2]

Lucene::PayloadAttribute::PayloadAttribute ( const PayloadPtr payload)

Initialize this attribute with the given payload.

◆ ~PayloadAttribute()

virtual Lucene::PayloadAttribute::~PayloadAttribute ( )
virtual

Member Function Documentation

◆ _getClassName()

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

◆ clear()

virtual void Lucene::PayloadAttribute::clear ( )
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.

Implements Lucene::Attribute.

◆ clone()

virtual LuceneObjectPtr Lucene::PayloadAttribute::clone ( const LuceneObjectPtr other = LuceneObjectPtr())
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.

Implements Lucene::Attribute.

◆ copyTo()

virtual void Lucene::PayloadAttribute::copyTo ( const AttributePtr target)
virtual

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

Implements Lucene::Attribute.

◆ equals()

virtual bool Lucene::PayloadAttribute::equals ( const LuceneObjectPtr other)
virtual

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

see also LuceneObject#equals(Object)

Implements Lucene::Attribute.

◆ getClassName()

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

Reimplemented from Lucene::Attribute.

◆ getPayload()

virtual PayloadPtr Lucene::PayloadAttribute::getPayload ( )
virtual

Returns this Token's payload.

◆ hashCode()

virtual int32_t Lucene::PayloadAttribute::hashCode ( )
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)

Implements Lucene::Attribute.

◆ setPayload()

virtual void Lucene::PayloadAttribute::setPayload ( const PayloadPtr payload)
virtual

Sets this Token's payload.

◆ shared_from_this()

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

◆ toString()

virtual String Lucene::PayloadAttribute::toString ( )
virtual

Returns a string representation of the object.

Reimplemented from Lucene::LuceneObject.

Field Documentation

◆ payload

PayloadPtr Lucene::PayloadAttribute::payload
protected

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

clucene.sourceforge.net