java.lang.Object | |
↳ | org.apache.lucene.index.Payload |
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 getPayloadLength()
and getPayload(byte[], int)
to retrieve the payloads from the index.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data | the byte array containing the payload data | ||||||||||
length | the length of the payload data | ||||||||||
offset | the offset within the byte array |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty payload and does not allocate a byte array.
| |||||||||||
Creates a new payload with the the given array as data.
| |||||||||||
Creates a new payload with the the given array as data.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the byte at the given index.
| |||||||||||
Clones this payload by creating a copy of the underlying
byte array.
| |||||||||||
Copies the payload data to a byte array.
| |||||||||||
Returns a reference to the underlying byte array
that holds this payloads data.
| |||||||||||
Returns the offset in the underlying byte array
| |||||||||||
Returns the length of the payload data.
| |||||||||||
Sets this payloads data.
| |||||||||||
Sets this payloads data.
| |||||||||||
Allocates a new byte array, copies the payload data into it and returns it.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
the byte array containing the payload data
the length of the payload data
the offset within the byte array
Creates an empty payload and does not allocate a byte array.
Creates a new payload with the the given array as data. A reference to the passed-in array is held, i. e. no copy is made.
data | the data of this payload |
---|
Creates a new payload with the the given array as data. A reference to the passed-in array is held, i. e. no copy is made.
data | the data of this payload |
---|---|
offset | the offset in the data byte array |
length | the length of the data |
Returns the byte at the given index.
Copies the payload data to a byte array.
target | the target byte array |
---|---|
targetOffset | the offset in the target byte array |
Returns a reference to the underlying byte array that holds this payloads data.
Returns the offset in the underlying byte array
Returns the length of the payload data.
Sets this payloads data. A reference to the passed-in array is held, i. e. no copy is made.
Sets this payloads data. A reference to the passed-in array is held, i. e. no copy is made.
Allocates a new byte array, copies the payload data into it and returns it.