The start and end character offset of a Token.
More...
#include <OffsetAttribute.h>
|
| OffsetAttribute () |
|
virtual | ~OffsetAttribute () |
|
virtual String | getClassName () |
|
boost::shared_ptr< OffsetAttribute > | shared_from_this () |
|
virtual String | toString () |
| Returns a string representation of the object.
|
|
virtual int32_t | startOffset () |
| Returns this Token's starting offset, the position of the first character corresponding to this token in the source text.
|
|
virtual void | setOffset (int32_t startOffset, int32_t endOffset) |
| Set the starting and ending offset.
|
|
virtual int32_t | endOffset () |
| Returns this Token's ending offset, one greater than the position of the last character corresponding to this token in the source text. The length of the token in the source text is (endOffset - startOffset).
|
|
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.
|
|
virtual | ~Attribute () |
|
boost::shared_ptr< Attribute > | shared_from_this () |
|
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 | ~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.
|
|
The start and end character offset of a Token.
◆ OffsetAttribute()
Lucene::OffsetAttribute::OffsetAttribute |
( |
| ) |
|
◆ ~OffsetAttribute()
virtual Lucene::OffsetAttribute::~OffsetAttribute |
( |
| ) |
|
|
virtual |
◆ _getClassName()
static String Lucene::OffsetAttribute::_getClassName |
( |
| ) |
|
|
inlinestatic |
◆ clear()
virtual void Lucene::OffsetAttribute::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()
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. |
Implements Lucene::Attribute.
◆ copyTo()
virtual void Lucene::OffsetAttribute::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.
◆ endOffset()
virtual int32_t Lucene::OffsetAttribute::endOffset |
( |
| ) |
|
|
virtual |
Returns this Token's ending offset, one greater than the position of the last character corresponding to this token in the source text. The length of the token in the source text is (endOffset - startOffset).
◆ equals()
virtual bool Lucene::OffsetAttribute::equals |
( |
const LuceneObjectPtr & |
other | ) |
|
|
virtual |
◆ getClassName()
virtual String Lucene::OffsetAttribute::getClassName |
( |
| ) |
|
|
inlinevirtual |
◆ hashCode()
virtual int32_t Lucene::OffsetAttribute::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.
◆ setOffset()
virtual void Lucene::OffsetAttribute::setOffset |
( |
int32_t |
startOffset, |
|
|
int32_t |
endOffset |
|
) |
| |
|
virtual |
◆ shared_from_this()
boost::shared_ptr< OffsetAttribute > Lucene::OffsetAttribute::shared_from_this |
( |
| ) |
|
|
inline |
◆ startOffset()
virtual int32_t Lucene::OffsetAttribute::startOffset |
( |
| ) |
|
|
virtual |
Returns this Token's starting offset, the position of the first character corresponding to this token in the source text.
Note that the difference between endOffset() and startOffset() may not be equal to termText.length(), as the term text may have been altered by a stemmer or some other filter.
◆ toString()
virtual String Lucene::OffsetAttribute::toString |
( |
| ) |
|
|
virtual |
◆ _endOffset
int32_t Lucene::OffsetAttribute::_endOffset |
|
protected |
◆ _startOffset
int32_t Lucene::OffsetAttribute::_startOffset |
|
protected |
The documentation for this class was generated from the following file: