# Print output for @column tags ?>
public
abstract
class
TextClassifierEvent
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.view.textclassifier.TextClassifierEvent |
This class represents events that are sent by components to the TextClassifier
to report
something of note that relates to a feature powered by the TextClassifier. The TextClassifier may
log these events or use them to improve future responses to queries.
Each category of events has its their own subclass. Events of each type have an associated set of related properties. You can find their specification in the subclasses.
Nested classes | |
---|---|
class |
TextClassifierEvent.Builder<T extends Builder<T>>
Builder to build a text classifier event. |
class |
TextClassifierEvent.ConversationActionsEvent
This class represents events that are related to the conversation actions feature. |
class |
TextClassifierEvent.LanguageDetectionEvent
This class represents events that are related to the language detection feature. |
class |
TextClassifierEvent.TextLinkifyEvent
This class represents events that are related to the smart linkify feature. |
class |
TextClassifierEvent.TextSelectionEvent
This class represents events that are related to the smart text selection feature. |
Constants | |
---|---|
int |
CATEGORY_CONVERSATION_ACTIONS
Conversation actions |
int |
CATEGORY_LANGUAGE_DETECTION
Language detection |
int |
CATEGORY_LINKIFY
Linkify |
int |
CATEGORY_SELECTION
Smart selection |
int |
TYPE_ACTIONS_GENERATED
TextClassifier generated some actions |
int |
TYPE_ACTIONS_SHOWN
Smart actions shown to the user. |
int |
TYPE_AUTO_SELECTION
Something else other than user or the default TextClassifier triggered a selection. |
int |
TYPE_COPY_ACTION
User clicked on Copy action. |
int |
TYPE_CUT_ACTION
User clicked on Cut action. |
int |
TYPE_LINKS_GENERATED
Some text links were generated. |
int |
TYPE_LINK_CLICKED
User clicked a link. |
int |
TYPE_MANUAL_REPLY
User composed a reply. |
int |
TYPE_OTHER_ACTION
User clicked on a custom action. |
int |
TYPE_OVERTYPE
User typed over the selection. |
int |
TYPE_PASTE_ACTION
User clicked on Paste action. |
int |
TYPE_SELECTION_DESTROYED
Selection is destroyed. |
int |
TYPE_SELECTION_DRAG
User dragged+dropped the selection. |
int |
TYPE_SELECTION_MODIFIED
User modified an existing selection. |
int |
TYPE_SELECTION_RESET
User reset the smart selection. |
int |
TYPE_SELECTION_STARTED
User started a new selection. |
int |
TYPE_SELECT_ALL
User clicked on Select All action |
int |
TYPE_SHARE_ACTION
User clicked on Share action. |
int |
TYPE_SMART_ACTION
User clicked on a Smart action. |
int |
TYPE_SMART_SELECTION_MULTI
Smart selection triggered spanning multiple tokens (words). |
int |
TYPE_SMART_SELECTION_SINGLE
Smart selection triggered for a single token (word). |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<TextClassifierEvent> |
CREATOR
|
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
int[]
|
getActionIndices()
Returns the indices of the actions relating to this event. |
String[]
|
getEntityTypes()
Returns an array of entity types. |
int
|
getEventCategory()
Returns the event category. |
TextClassificationContext
|
getEventContext()
Returns the event context. |
int
|
getEventIndex()
Returns the index of this event in the series of event it belongs to. |
int
|
getEventType()
Returns the event type. |
Bundle
|
getExtras()
Returns a bundle containing non-structured extra information about this event. |
ULocale
|
getLocale()
Returns the detected locale. |
String
|
getModelName()
Returns the model name. |
String
|
getResultId()
Returns the id of the text classifier result related to this event. |
float[]
|
getScores()
Returns the scores of the suggestions. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
public static final int CATEGORY_CONVERSATION_ACTIONS
Conversation actions
Constant Value: 3 (0x00000003)
public static final int CATEGORY_LANGUAGE_DETECTION
Language detection
Constant Value: 4 (0x00000004)
public static final int CATEGORY_LINKIFY
Linkify
See also:
Constant Value: 2 (0x00000002)
public static final int CATEGORY_SELECTION
Smart selection
See also:
Constant Value: 1 (0x00000001)
public static final int TYPE_ACTIONS_GENERATED
TextClassifier generated some actions
Constant Value: 20 (0x00000014)
public static final int TYPE_ACTIONS_SHOWN
Smart actions shown to the user.
Constant Value: 6 (0x00000006)
public static final int TYPE_AUTO_SELECTION
Something else other than user or the default TextClassifier triggered a selection.
Constant Value: 5 (0x00000005)
public static final int TYPE_COPY_ACTION
User clicked on Copy action.
Constant Value: 9 (0x00000009)
public static final int TYPE_CUT_ACTION
User clicked on Cut action.
Constant Value: 11 (0x0000000b)
public static final int TYPE_LINKS_GENERATED
Some text links were generated.
Constant Value: 21 (0x00000015)
public static final int TYPE_LINK_CLICKED
User clicked a link.
Constant Value: 7 (0x00000007)
public static final int TYPE_MANUAL_REPLY
User composed a reply.
Constant Value: 19 (0x00000013)
public static final int TYPE_OTHER_ACTION
User clicked on a custom action.
Constant Value: 16 (0x00000010)
public static final int TYPE_OVERTYPE
User typed over the selection.
Constant Value: 8 (0x00000008)
public static final int TYPE_PASTE_ACTION
User clicked on Paste action.
Constant Value: 10 (0x0000000a)
public static final int TYPE_SELECTION_DESTROYED
Selection is destroyed.
Constant Value: 15 (0x0000000f)
public static final int TYPE_SELECTION_DRAG
User dragged+dropped the selection.
Constant Value: 14 (0x0000000e)
public static final int TYPE_SELECTION_MODIFIED
User modified an existing selection.
Constant Value: 2 (0x00000002)
public static final int TYPE_SELECTION_RESET
User reset the smart selection.
Constant Value: 18 (0x00000012)
public static final int TYPE_SELECTION_STARTED
User started a new selection.
Constant Value: 1 (0x00000001)
public static final int TYPE_SELECT_ALL
User clicked on Select All action
Constant Value: 17 (0x00000011)
public static final int TYPE_SHARE_ACTION
User clicked on Share action.
Constant Value: 12 (0x0000000c)
public static final int TYPE_SMART_ACTION
User clicked on a Smart action.
Constant Value: 13 (0x0000000d)
public static final int TYPE_SMART_SELECTION_MULTI
Smart selection triggered spanning multiple tokens (words).
Constant Value: 4 (0x00000004)
public static final int TYPE_SMART_SELECTION_SINGLE
Smart selection triggered for a single token (word).
Constant Value: 3 (0x00000003)
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public int[] getActionIndices ()
Returns the indices of the actions relating to this event. Actions are usually returned by the text classifier in priority order with the most preferred action at index 0. This list gives an indication of the position of the actions that are being reported.
Returns | |
---|---|
int[] |
This value cannot be null . |
public String[] getEntityTypes ()
Returns an array of entity types. e.g. TextClassifier#TYPE_ADDRESS
.
Returns | |
---|---|
String[] |
This value cannot be null . |
See also:
public int getEventCategory ()
Returns the event category. e.g. CATEGORY_SELECTION
.
Returns | |
---|---|
int |
Value is CATEGORY_SELECTION , CATEGORY_LINKIFY , CATEGORY_CONVERSATION_ACTIONS , or CATEGORY_LANGUAGE_DETECTION |
public TextClassificationContext getEventContext ()
Returns the event context.
Returns | |
---|---|
TextClassificationContext |
This value may be null . |
public int getEventIndex ()
Returns the index of this event in the series of event it belongs to.
Returns | |
---|---|
int |
public int getEventType ()
Returns the event type. e.g. TYPE_SELECTION_STARTED
.
Returns | |
---|---|
int |
Value is TYPE_SELECTION_STARTED , TYPE_SELECTION_MODIFIED , TYPE_SMART_SELECTION_SINGLE , TYPE_SMART_SELECTION_MULTI , TYPE_AUTO_SELECTION , TYPE_ACTIONS_SHOWN , TYPE_LINK_CLICKED , TYPE_OVERTYPE , TYPE_COPY_ACTION , TYPE_PASTE_ACTION , TYPE_CUT_ACTION , TYPE_SHARE_ACTION , TYPE_SMART_ACTION , TYPE_SELECTION_DRAG , TYPE_SELECTION_DESTROYED , TYPE_OTHER_ACTION , TYPE_SELECT_ALL , TYPE_SELECTION_RESET , TYPE_MANUAL_REPLY , TYPE_ACTIONS_GENERATED , TYPE_LINKS_GENERATED , or android.view.textclassifier.TextClassifierEvent.TYPE_READ_CLIPBOARD |
public Bundle getExtras ()
Returns a bundle containing non-structured extra information about this event.
NOTE: Do not modify this bundle.
Returns | |
---|---|
Bundle |
This value cannot be null . |
public ULocale getLocale ()
Returns the detected locale.
Returns | |
---|---|
ULocale |
This value may be null . |
public String getModelName ()
Returns the model name.
Returns | |
---|---|
String |
This value may be null . |
public String getResultId ()
Returns the id of the text classifier result related to this event.
Returns | |
---|---|
String |
This value may be null . |
public float[] getScores ()
Returns the scores of the suggestions.
Returns | |
---|---|
float[] |
This value cannot be null . |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |