Builder
class Builder
kotlin.Any | |
↳ | androidx.textclassifier.TextSelection.Builder |
Builder used to build TextSelection
objects.
Summary
Public constructors | |
---|---|
Creates a builder used to build |
Public methods | |
---|---|
TextSelection |
build() Builds and returns |
TextSelection.Builder |
setEntityType(@NonNull type: String, @FloatRange(0.0, 1.0) confidenceScore: Float) Sets an entity type for the classified text and assigns a confidence score. |
TextSelection.Builder |
Sets the extended, vendor specific data. |
TextSelection.Builder |
Sets an id for the TextSelection object. |
Public constructors
<init>
Builder(
@IntRange(0) startIndex: Int,
@IntRange(0) endIndex: Int)
Creates a builder used to build TextSelection
objects.
Parameters | |
---|---|
startIndex |
Int: the start index of the text selection. |
endIndex |
Int: the end index of the text selection. Must be greater than startIndex |
Public methods
setEntityType
@NonNull fun setEntityType(
@NonNull type: String,
@FloatRange(0.0, 1.0) confidenceScore: Float
): TextSelection.Builder
Sets an entity type for the classified text and assigns a confidence score.
Parameters | |
---|---|
confidenceScore |
Float: a value from 0 (low confidence) to 1 (high confidence). 0 implies the entity does not exist for the classified text. Values greater than 1 are clamped to 1. |
setExtras
@NonNull fun setExtras(@Nullable extras: Bundle?): TextSelection.Builder
Sets the extended, vendor specific data.
setId
@NonNull fun setId(@Nullable id: String?): TextSelection.Builder
Sets an id for the TextSelection object.