Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Properties | List of all members
Lucene.Net.Analysis.Tokenattributes.ITermAttribute Interface Reference

The term text of a Token. More...

Inherits Lucene.Net.Util.IAttribute.

Inherited by Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

Public Member Functions

void SetTermBuffer (char[] buffer, int offset, int length)
 Copies the contents of buffer, starting at offset for length characters, into the termBuffer array.
 
void SetTermBuffer (System.String buffer)
 Copies the contents of buffer into the termBuffer array.
 
void SetTermBuffer (System.String buffer, int offset, int length)
 Copies the contents of buffer, starting at offset and continuing for length characters, into the termBuffer array.
 
char[] TermBuffer ()
 Returns the internal termBuffer character array which you can then directly alter. If the array is too small for your token, use ResizeTermBuffer(int) to increase it. After altering the buffer be sure to call SetTermLength to record the number of valid characters that were placed into the termBuffer.
 
char[] ResizeTermBuffer (int newSize)
 Grows the termBuffer to at least size newSize, preserving the existing content. Note: If the next operation is to change the contents of the term buffer use SetTermBuffer(char[], int, int), SetTermBuffer(String), or SetTermBuffer(String, int, int) to optimally combine the resize with the setting of the termBuffer.
 
int TermLength ()
 Return number of valid characters (length of the term) in the termBuffer array.
 
void SetTermLength (int length)
 Set number of valid characters (length of the term) in the termBuffer array. Use this to truncate the termBuffer or to synchronize with external manipulation of the termBuffer. Note: to grow the size of the array, use ResizeTermBuffer(int) first.
 

Properties

string Term [get]
 Returns the Token's term text.
 

Detailed Description

The term text of a Token.

Definition at line 25 of file ITermAttribute.cs.

Member Function Documentation

char [] Lucene.Net.Analysis.Tokenattributes.ITermAttribute.ResizeTermBuffer ( int  newSize)

Grows the termBuffer to at least size newSize, preserving the existing content. Note: If the next operation is to change the contents of the term buffer use SetTermBuffer(char[], int, int), SetTermBuffer(String), or SetTermBuffer(String, int, int) to optimally combine the resize with the setting of the termBuffer.

Parameters
newSizeminimum size of the new termBuffer
Returns
newly created termBuffer with length >= newSize

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

void Lucene.Net.Analysis.Tokenattributes.ITermAttribute.SetTermBuffer ( char[]  buffer,
int  offset,
int  length 
)

Copies the contents of buffer, starting at offset for length characters, into the termBuffer array.

Parameters
bufferthe buffer to copy
offsetthe index in the buffer of the first character to copy
lengththe number of characters to copy

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

void Lucene.Net.Analysis.Tokenattributes.ITermAttribute.SetTermBuffer ( System.String  buffer)

Copies the contents of buffer into the termBuffer array.

Parameters
bufferthe buffer to copy

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

void Lucene.Net.Analysis.Tokenattributes.ITermAttribute.SetTermBuffer ( System.String  buffer,
int  offset,
int  length 
)

Copies the contents of buffer, starting at offset and continuing for length characters, into the termBuffer array.

Parameters
bufferthe buffer to copy
offsetthe index in the buffer of the first character to copy
lengththe number of characters to copy

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

void Lucene.Net.Analysis.Tokenattributes.ITermAttribute.SetTermLength ( int  length)

Set number of valid characters (length of the term) in the termBuffer array. Use this to truncate the termBuffer or to synchronize with external manipulation of the termBuffer. Note: to grow the size of the array, use ResizeTermBuffer(int) first.

Parameters
lengththe truncated length

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

char [] Lucene.Net.Analysis.Tokenattributes.ITermAttribute.TermBuffer ( )

Returns the internal termBuffer character array which you can then directly alter. If the array is too small for your token, use ResizeTermBuffer(int) to increase it. After altering the buffer be sure to call SetTermLength to record the number of valid characters that were placed into the termBuffer.

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

int Lucene.Net.Analysis.Tokenattributes.ITermAttribute.TermLength ( )

Return number of valid characters (length of the term) in the termBuffer array.

Implemented in Lucene.Net.Analysis.Token, and Lucene.Net.Analysis.Tokenattributes.TermAttribute.

Property Documentation

string Lucene.Net.Analysis.Tokenattributes.ITermAttribute.Term
get

Returns the Token's term text.

This method has a performance penalty because the text is stored internally in a char[]. If possible, use TermBuffer() and TermLength() directly instead. If you really need a String, use this method, which is nothing more than a convenience call to new String(token.termBuffer(), 0, token.termLength())

Definition at line 36 of file ITermAttribute.cs.


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