The start and end character offset of a Token.
More...
#include <OffsetAttribute.h>
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: