AttributeImpl

Base class for Attributes that can be added to a org.gnit.lucenekmp.util.AttributeSource.

Attributes are used to add data in a dynamic, yet type-safe way to a source of usually streamed objects, e. g. a org.gnit.lucenekmp.analysis.TokenStream.

All implementations must list all implemented Attribute interfaces in their implements clause. AttributeSource reflectively identifies all attributes and makes them available to consumers like TokenStreams.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun clear()

Clears the values in this AttributeImpl and resets it to its default value. If this implementation implements more than one Attribute interface it clears all.

Link copied to clipboard
open override fun clone(): AttributeImpl

In most cases the clone is, and should be, deep in order to be able to properly capture the state of all attributes.

Link copied to clipboard
abstract fun copyTo(target: AttributeImpl)

Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.

Link copied to clipboard
open fun end()

Clears the values in this AttributeImpl and resets it to its value at the end of the field. If this implementation implements more than one Attribute interface it clears all.

Link copied to clipboard
fun reflectAsString(prependAttClass: Boolean): String

This method returns the current attribute values as a string in the following format by calling the .reflectWith method:

Link copied to clipboard
abstract fun reflectWith(reflector: AttributeReflector)

This method is for introspection of attributes, it should simply add the key/values this attribute holds to the given AttributeReflector.