Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Properties | List of all members
Lucene.Net.Index.Payload Class Reference

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.PayloadLength and TermPositions.GetPayload(byte[], int) to retrieve the payloads from the index.
More...

Inherits ICloneable.

Public Member Functions

 Payload ()
 Creates an empty payload and does not allocate a byte array.
 
 Payload (byte[] data)
 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.
 
 Payload (byte[] data, int offset, int length)
 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.
 
virtual void SetData (byte[] value, int offset, int length)
 Sets this payloads data. A reference to the passed-in array is held, i. e. no copy is made.
 
virtual void SetData (byte[] value)
 Gets or sets a reference to the underlying byte array that holds this payloads data. Data is not copied.
 
virtual byte[] GetData ()
 Gets or sets a reference to the underlying byte array that holds this payloads data. Data is not copied.
 
virtual byte ByteAt (int index)
 Returns the byte at the given index.
 
virtual byte[] ToByteArray ()
 Allocates a new byte array, copies the payload data into it and returns it.
 
virtual void CopyTo (byte[] target, int targetOffset)
 Copies the payload data to a byte array.
 
virtual System.Object Clone ()
 Clones this payload by creating a copy of the underlying byte array.
 
override bool Equals (System.Object obj)
 
override int GetHashCode ()
 

Properties

virtual int Offset [get]
 Returns the offset in the underlying byte array
 
virtual int Length [get]
 Returns the length of the payload data.
 

Detailed Description

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.PayloadLength and TermPositions.GetPayload(byte[], int) to retrieve the payloads from the index.

Definition at line 38 of file Payload.cs.

Constructor & Destructor Documentation

Lucene.Net.Index.Payload.Payload ( )

Creates an empty payload and does not allocate a byte array.

Definition at line 50 of file Payload.cs.

Lucene.Net.Index.Payload.Payload ( byte[]  data)

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.

Parameters
datathe data of this payload

Definition at line 62 of file Payload.cs.

Lucene.Net.Index.Payload.Payload ( byte[]  data,
int  offset,
int  length 
)

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.

Parameters
datathe data of this payload
offsetthe offset in the data byte array
lengththe length of the data

Definition at line 77 of file Payload.cs.

Member Function Documentation

virtual byte Lucene.Net.Index.Payload.ByteAt ( int  index)
virtual

Returns the byte at the given index.

Definition at line 128 of file Payload.cs.

virtual System.Object Lucene.Net.Index.Payload.Clone ( )
virtual

Clones this payload by creating a copy of the underlying byte array.

Definition at line 164 of file Payload.cs.

virtual void Lucene.Net.Index.Payload.CopyTo ( byte[]  target,
int  targetOffset 
)
virtual

Copies the payload data to a byte array.

Parameters
targetthe target byte array
targetOffsetthe offset in the target byte array

Definition at line 152 of file Payload.cs.

override bool Lucene.Net.Index.Payload.Equals ( System.Object  obj)

Definition at line 191 of file Payload.cs.

virtual byte [] Lucene.Net.Index.Payload.GetData ( )
virtual

Gets or sets a reference to the underlying byte array that holds this payloads data. Data is not copied.

Definition at line 110 of file Payload.cs.

override int Lucene.Net.Index.Payload.GetHashCode ( )

Definition at line 212 of file Payload.cs.

virtual void Lucene.Net.Index.Payload.SetData ( byte[]  value,
int  offset,
int  length 
)
virtual

Sets this payloads data. A reference to the passed-in array is held, i. e. no copy is made.

Definition at line 92 of file Payload.cs.

virtual void Lucene.Net.Index.Payload.SetData ( byte[]  value)
virtual

Gets or sets a reference to the underlying byte array that holds this payloads data. Data is not copied.

Definition at line 102 of file Payload.cs.

virtual byte [] Lucene.Net.Index.Payload.ToByteArray ( )
virtual

Allocates a new byte array, copies the payload data into it and returns it.

Definition at line 138 of file Payload.cs.

Property Documentation

virtual int Lucene.Net.Index.Payload.Length
get

Returns the length of the payload data.

Definition at line 123 of file Payload.cs.

virtual int Lucene.Net.Index.Payload.Offset
get

Returns the offset in the underlying byte array

Definition at line 117 of file Payload.cs.


The documentation for this class was generated from the following file: