Class CharTermAttributeExtensions
Inheritance
CharTermAttributeExtensions
Assembly: Lucene.Net.dll
Syntax
public static class CharTermAttributeExtensions
Methods
SetEmpty<T>(T)
Sets the length of the termBuffer to zero.
Use this method before appending contents.
NOTE: This is exactly the same operation as calling
Clear(), the primary
difference is that this method returns a reference to the current object so it can be chained.
obj.SetEmpty().Append("hey you");
Declaration
public static T SetEmpty<T>(this T termAttr) where T : ICharTermAttribute
Parameters
| Type |
Name |
Description |
| T |
termAttr |
|
Returns
Type Parameters
SetLength<T>(T, int)
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 ResizeBuffer(int) first.
NOTE: This is exactly the same operation as calling the
Length setter, the primary
difference is that this method returns a reference to the current object so it can be chained.
obj.SetLength(30).Append("hey you");
Declaration
public static T SetLength<T>(this T termAttr, int length) where T : ICharTermAttribute
Parameters
| Type |
Name |
Description |
| T |
termAttr |
|
| int |
length |
The truncated length
|
Returns
Type Parameters