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.TermAttribute Class Reference

The term text of a Token. More...

Inherits Attribute, Lucene.Net.Analysis.Tokenattributes.ITermAttribute, and ICloneable.

Public Member Functions

virtual void SetTermBuffer (char[] buffer, int offset, int length)
 Copies the contents of buffer, starting at offset for length characters, into the termBuffer array.
 
virtual void SetTermBuffer (System.String buffer)
 Copies the contents of buffer into the termBuffer array.
 
virtual 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.
 
virtual 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.
 
virtual 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.
 
virtual int TermLength ()
 Return number of valid characters (length of the term) in the termBuffer array.
 
virtual 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.
 
override int GetHashCode ()
 
override void Clear ()
 
override System.Object Clone ()
 
override bool Equals (System.Object other)
 
override System.String ToString ()
 
override void CopyTo (Attribute target)
 

Properties

virtual string Term [get]
 Returns the Token's term text.
 
- Properties inherited from Lucene.Net.Analysis.Tokenattributes.ITermAttribute
string Term [get]
 Returns the Token's term text.
 

Detailed Description

The term text of a Token.

Definition at line 28 of file TermAttribute.cs.

Member Function Documentation

override void Lucene.Net.Analysis.Tokenattributes.TermAttribute.Clear ( )

Definition at line 210 of file TermAttribute.cs.

override System.Object Lucene.Net.Analysis.Tokenattributes.TermAttribute.Clone ( )

Definition at line 215 of file TermAttribute.cs.

override void Lucene.Net.Analysis.Tokenattributes.TermAttribute.CopyTo ( Attribute  target)

Definition at line 261 of file TermAttribute.cs.

override bool Lucene.Net.Analysis.Tokenattributes.TermAttribute.Equals ( System.Object  other)

Definition at line 227 of file TermAttribute.cs.

override int Lucene.Net.Analysis.Tokenattributes.TermAttribute.GetHashCode ( )

Definition at line 202 of file TermAttribute.cs.

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

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

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 124 of file TermAttribute.cs.

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

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

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 62 of file TermAttribute.cs.

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

Copies the contents of buffer into the termBuffer array.

Parameters
bufferthe buffer to copy

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 72 of file TermAttribute.cs.

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

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

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 89 of file TermAttribute.cs.

virtual void Lucene.Net.Analysis.Tokenattributes.TermAttribute.SetTermLength ( int  length)
virtual

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

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 194 of file TermAttribute.cs.

virtual char [] Lucene.Net.Analysis.Tokenattributes.TermAttribute.TermBuffer ( )
virtual

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.

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 106 of file TermAttribute.cs.

virtual int Lucene.Net.Analysis.Tokenattributes.TermAttribute.TermLength ( )
virtual

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

Implements Lucene.Net.Analysis.Tokenattributes.ITermAttribute.

Definition at line 181 of file TermAttribute.cs.

override System.String Lucene.Net.Analysis.Tokenattributes.TermAttribute.ToString ( )

Definition at line 255 of file TermAttribute.cs.

Property Documentation

virtual string Lucene.Net.Analysis.Tokenattributes.TermAttribute.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 45 of file TermAttribute.cs.


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