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


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

A Token's lexical type. The Default value is "word". More...

#include <TypeAttribute.h>

+ Inheritance diagram for Lucene::TypeAttribute:

Public Member Functions

 TypeAttribute ()
 
 TypeAttribute (const String &type)
 
virtual ~TypeAttribute ()
 
virtual String getClassName ()
 
boost::shared_ptr< TypeAttributeshared_from_this ()
 
virtual String toString ()
 Returns a string representation of the object.
 
String type ()
 Returns this Token's lexical type. Defaults to "word".
 
void setType (const String &type)
 Set the lexical type.
 
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 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.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Shallow clone. Subclasses must override this if they need to clone any members deeply.
 
- 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 ()
 

Static Protected Member Functions

static const String & DEFAULT_TYPE ()
 

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

A Token's lexical type. The Default value is "word".

Constructor & Destructor Documentation

◆ TypeAttribute() [1/2]

Lucene::TypeAttribute::TypeAttribute ( )

◆ TypeAttribute() [2/2]

Lucene::TypeAttribute::TypeAttribute ( const String &  type)

◆ ~TypeAttribute()

virtual Lucene::TypeAttribute::~TypeAttribute ( )
virtual

Member Function Documentation

◆ _getClassName()

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

◆ clear()

virtual void Lucene::TypeAttribute::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::TypeAttribute::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::TypeAttribute::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.

◆ DEFAULT_TYPE()

static const String & Lucene::TypeAttribute::DEFAULT_TYPE ( )
staticprotected

◆ equals()

virtual bool Lucene::TypeAttribute::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::TypeAttribute::getClassName ( )
inlinevirtual

Reimplemented from Lucene::Attribute.

◆ hashCode()

virtual int32_t Lucene::TypeAttribute::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.

◆ setType()

void Lucene::TypeAttribute::setType ( const String &  type)

Set the lexical type.

See also
type()

◆ shared_from_this()

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

◆ toString()

virtual String Lucene::TypeAttribute::toString ( )
virtual

Returns a string representation of the object.

Reimplemented from Lucene::LuceneObject.

◆ type()

String Lucene::TypeAttribute::type ( )

Returns this Token's lexical type. Defaults to "word".

Field Documentation

◆ _type

String Lucene::TypeAttribute::_type
protected

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

clucene.sourceforge.net