Lucene++ - a full-featured, c++ search engine
API Documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lucene++
OffsetAttribute.h
Go to the documentation of this file.
1
2
// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3
// Distributable under the terms of either the Apache License (Version 2.0)
4
// or the GNU Lesser General Public License.
6
7
#ifndef OFFSETATTRIBUTE_H
8
#define OFFSETATTRIBUTE_H
9
10
#include "
Attribute.h
"
11
12
namespace
Lucene
{
13
15
class
LPPAPI
OffsetAttribute
:
public
Attribute
{
16
public
:
17
OffsetAttribute
();
18
virtual
~OffsetAttribute
();
19
20
LUCENE_CLASS
(
OffsetAttribute
);
21
22
protected
:
23
int32_t
_startOffset
;
24
int32_t
_endOffset
;
25
26
public
:
27
virtual
String
toString
();
28
34
virtual
int32_t
startOffset
();
35
38
virtual
void
setOffset
(int32_t
startOffset
, int32_t
endOffset
);
39
42
virtual
int32_t
endOffset
();
43
44
virtual
void
clear
();
45
virtual
bool
equals
(
const
LuceneObjectPtr
& other);
46
virtual
int32_t
hashCode
();
47
virtual
void
copyTo
(
const
AttributePtr
& target);
48
virtual
LuceneObjectPtr
clone
(
const
LuceneObjectPtr
& other =
LuceneObjectPtr
());
49
};
50
51
}
52
53
#endif
Attribute.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition
LuceneObject.h:24
Lucene::Attribute
Base class for Attributes that can be added to a AttributeSource.
Definition
Attribute.h:18
Lucene::OffsetAttribute::~OffsetAttribute
virtual ~OffsetAttribute()
Lucene::OffsetAttribute::_startOffset
int32_t _startOffset
Definition
OffsetAttribute.h:23
Lucene::OffsetAttribute::_endOffset
int32_t _endOffset
Definition
OffsetAttribute.h:24
Lucene::OffsetAttribute::toString
virtual String toString()
Returns a string representation of the object.
Lucene::OffsetAttribute::startOffset
virtual int32_t startOffset()
Returns this Token's starting offset, the position of the first character corresponding to this token...
Lucene::OffsetAttribute::endOffset
virtual int32_t endOffset()
Returns this Token's ending offset, one greater than the position of the last character corresponding...
Lucene::OffsetAttribute::setOffset
virtual void setOffset(int32_t startOffset, int32_t endOffset)
Set the starting and ending offset.
Lucene::OffsetAttribute::equals
virtual bool equals(const LuceneObjectPtr &other)
All values used for computation of hashCode() should be checked here for equality.
Lucene::OffsetAttribute::clear
virtual void clear()
Clears the values in this Attribute and resets it to its default value. If this implementation implem...
Lucene::OffsetAttribute::OffsetAttribute
OffsetAttribute()
Lucene::OffsetAttribute::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Shallow clone. Subclasses must override this if they need to clone any members deeply.
Lucene::OffsetAttribute::copyTo
virtual void copyTo(const AttributePtr &target)
Copies the values from this Attribute into the passed-in target attribute. The target implementation ...
Lucene::OffsetAttribute::hashCode
virtual int32_t hashCode()
Subclasses must implement this method and should compute a hashCode similar to this:
Lucene
Definition
AbstractAllTermDocs.h:12
Lucene::AttributePtr
boost::shared_ptr< Attribute > AttributePtr
Definition
LuceneTypes.h:518
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition
LuceneTypes.h:539
clucene.sourceforge.net