org.apache.lucene.analysis.tokenattributes.TermAttribute |
Known Indirect Subclasses |
The term text of a Token.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Grows the termBuffer to at least size newSize, preserving the
existing content.
| |||||||||||
Copies the contents of buffer, starting at offset and continuing
for length characters, into the termBuffer array.
| |||||||||||
Copies the contents of buffer, starting at offset for
length characters, into the termBuffer array.
| |||||||||||
Copies the contents of buffer into the termBuffer array.
| |||||||||||
Set number of valid characters (length of the term) in
the termBuffer array.
| |||||||||||
Returns the Token's term text.
| |||||||||||
Returns the internal termBuffer character array which
you can then directly alter.
| |||||||||||
Return number of valid characters (length of the term)
in the termBuffer array.
|
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.
newSize | minimum size of the new termBuffer |
---|
Copies the contents of buffer, starting at offset and continuing for length characters, into the termBuffer array.
buffer | the buffer to copy |
---|---|
offset | the index in the buffer of the first character to copy |
length | the number of characters to copy |
Copies the contents of buffer, starting at offset for length characters, into the termBuffer array.
buffer | the buffer to copy |
---|---|
offset | the index in the buffer of the first character to copy |
length | the number of characters to copy |
Copies the contents of buffer into the termBuffer array.
buffer | the buffer to copy |
---|
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.
length | the truncated length |
---|
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())
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(int)
to record the number of valid
characters that were placed into the termBuffer.
Return number of valid characters (length of the term) in the termBuffer array.