Lucene++ - a full-featured, c++ search engine
API Documentation
A Payload is metadata that can be stored together with each occurrence of a term. This metadata is stored inline in the posting list of the specific term. More...
#include <Payload.h>
Inheritance diagram for Lucene::Payload:Public Member Functions | |
| Payload () | |
| Creates an empty payload and does not allocate a byte array. More... | |
| Payload (ByteArray data) | |
| Creates a new payload with the the given array as data. A reference to the passed-in array is held, ie. no copy is made. More... | |
| Payload (ByteArray data, int32_t offset, int32_t length) | |
| Creates a new payload with the the given array as data. A reference to the passed-in array is held, ie. no copy is made. More... | |
| virtual | ~Payload () |
| virtual String | getClassName () |
| boost::shared_ptr< Payload > | shared_from_this () |
| void | setData (ByteArray data) |
| Sets this payloads data. A reference to the passed-in array is held, ie. no copy is made. More... | |
| void | setData (ByteArray data, int32_t offset, int32_t length) |
| Sets this payloads data. A reference to the passed-in array is held, ie. no copy is made. More... | |
| ByteArray | getData () |
| Returns a reference to the underlying byte array that holds this payloads data. More... | |
| int32_t | getOffset () |
| Returns the offset in the underlying byte array. More... | |
| int32_t | length () |
| Returns the length of the payload data. More... | |
| uint8_t | byteAt (int32_t index) |
| Returns the byte at the given index. More... | |
| ByteArray | toByteArray () |
| Allocates a new byte array, copies the payload data into it and returns it. More... | |
| void | copyTo (ByteArray target, int32_t targetOffset) |
| Copies the payload data to a byte array. More... | |
| virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
| Clones this payload by creating a copy of the underlying byte array. More... | |
| virtual bool | equals (const LuceneObjectPtr &other) |
| Return whether two objects are equal. More... | |
| virtual int32_t | hashCode () |
| Return hash code for this object. More... | |
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. More... | |
| virtual int32_t | compareTo (const LuceneObjectPtr &other) |
| Compare two objects. More... | |
| virtual String | toString () |
| Returns a string representation of the object. More... | |
Public Member Functions inherited from Lucene::LuceneSync | |
| virtual | ~LuceneSync () |
| virtual SynchronizePtr | getSync () |
| Return this object synchronize lock. More... | |
| virtual LuceneSignalPtr | getSignal () |
| Return this object signal. More... | |
| virtual void | lock (int32_t timeout=0) |
| Lock this object using an optional timeout. More... | |
| virtual void | unlock () |
| Unlock this object. More... | |
| virtual bool | holdsLock () |
| Returns true if this object is currently locked by current thread. More... | |
| virtual void | wait (int32_t timeout=0) |
| Wait for signal using an optional timeout. More... | |
| virtual void | notifyAll () |
| Notify all threads waiting for signal. More... | |
Static Public Member Functions | |
| static String | _getClassName () |
Protected Attributes | |
| ByteArray | data |
| the byte array containing the payload data More... | |
| int32_t | offset |
| the offset within the byte array More... | |
| int32_t | _length |
| the length of the payload data More... | |
Protected Attributes inherited from Lucene::LuceneSync | |
| SynchronizePtr | objectLock |
| LuceneSignalPtr | objectSignal |
Additional Inherited Members | |
Protected Member Functions inherited from Lucene::LuceneObject | |
| LuceneObject () | |
A Payload is metadata that can be stored together with each occurrence of a term. This metadata is stored inline in the posting list of the specific term.
To store payloads in the index a TokenStream has to be used that produces payload data.
Use TermPositions#getPayloadLength() and TermPositions#getPayload(byte[], int) to retrieve the payloads from the index.
| Lucene::Payload::Payload | ( | ) |
Creates an empty payload and does not allocate a byte array.
| Lucene::Payload::Payload | ( | ByteArray | data | ) |
Creates a new payload with the the given array as data. A reference to the passed-in array is held, ie. no copy is made.
| data | the data of this payload |
| Lucene::Payload::Payload | ( | ByteArray | data, |
| int32_t | offset, | ||
| int32_t | length | ||
| ) |
Creates a new payload with the the given array as data. A reference to the passed-in array is held, ie. no copy is made.
| data | the data of this payload |
| offset | the offset in the data byte array |
| length | the length of the data |
|
virtual |
|
inlinestatic |
| uint8_t Lucene::Payload::byteAt | ( | int32_t | index | ) |
Returns the byte at the given index.
|
virtual |
Clones this payload by creating a copy of the underlying byte array.
Reimplemented from Lucene::LuceneObject.
| void Lucene::Payload::copyTo | ( | ByteArray | target, |
| int32_t | targetOffset | ||
| ) |
Copies the payload data to a byte array.
| target | the target byte array |
| targetOffset | the offset in the target byte array |
|
virtual |
Return whether two objects are equal.
Reimplemented from Lucene::LuceneObject.
|
inlinevirtual |
| ByteArray Lucene::Payload::getData | ( | ) |
Returns a reference to the underlying byte array that holds this payloads data.
| int32_t Lucene::Payload::getOffset | ( | ) |
Returns the offset in the underlying byte array.
|
virtual |
Return hash code for this object.
Reimplemented from Lucene::LuceneObject.
| int32_t Lucene::Payload::length | ( | ) |
Returns the length of the payload data.
| void Lucene::Payload::setData | ( | ByteArray | data | ) |
Sets this payloads data. A reference to the passed-in array is held, ie. no copy is made.
| void Lucene::Payload::setData | ( | ByteArray | data, |
| int32_t | offset, | ||
| int32_t | length | ||
| ) |
Sets this payloads data. A reference to the passed-in array is held, ie. no copy is made.
|
inline |
| ByteArray Lucene::Payload::toByteArray | ( | ) |
Allocates a new byte array, copies the payload data into it and returns it.
|
protected |
the length of the payload data
|
protected |
the byte array containing the payload data
|
protected |
the offset within the byte array