CharTermAttribute

The term text of a Token.

Inheritors

Properties

Link copied to clipboard
expect abstract val length: Int

Functions

Link copied to clipboard
abstract override fun append(c: Char): CharTermAttribute
abstract override fun append(csq: CharSequence?): CharTermAttribute
abstract override fun append(csq: CharSequence?, start: Int, end: Int): CharTermAttribute

abstract fun append(s: String): CharTermAttribute

Appends the specified String to this character sequence.

Appends the specified StringBuilder to this character sequence.

Appends the contents of the other CharTermAttribute to this character sequence.

Link copied to clipboard
abstract fun buffer(): CharArray

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

Link copied to clipboard

Returns the Unicode code point at the specified index of this CharSequence.

Link copied to clipboard

Returns a stream of code point values from this sequence. Any surrogate pairs encountered in the sequence are combined as if by {@linkplain Character#toCodePoint Character.toCodePoint} and the result is passed to the stream. Any other code units, including ordinary BMP characters, unpaired surrogates, and undefined code units, are zero-extended to {@code int} values which are then passed to the stream.

Link copied to clipboard
abstract fun copyBuffer(buffer: CharArray, offset: Int, length: Int)

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

Link copied to clipboard
expect abstract operator fun get(index: Int): Char
Link copied to clipboard
abstract fun resizeBuffer(newSize: Int): CharArray

Grows the termBuffer to at least size newSize, preserving the existing content.

Link copied to clipboard
abstract fun setEmpty(): CharTermAttribute?

Sets the length of the termBuffer to zero. Use this method before appending contents using the Appendable interface.

Link copied to clipboard
abstract fun setLength(length: Int): CharTermAttribute

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 first.

Link copied to clipboard
expect abstract fun subSequence(startIndex: Int, endIndex: Int): CharSequence