# EntityAnnotation

public final class **EntityAnnotation** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
An annotation of a piece of text.

The identified annotation refers to a substring of the text from the start index returned
by `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart()`
to the end index returned by `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd()`,
exclusively, with `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEntities()` returning a list of possible entities it could refer to.

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is "equal to" this one. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getAnnotatedText](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getAnnotatedText())() The text segment within the original text that this annotation refers to (from the start index returned by `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart()` to the end index returned by `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd()`, exclusively). |
| int | [getEnd](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd())() The end index (in Java chars) of the annotation in the original text, exclusive. |
| [List](https://developer.android.com/reference/java/util/List.html)\<[Entity](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/Entity)\> | [getEntities](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEntities())() A list of possible entities that this annotation could refer to. |
| int | [getStart](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart())() The start index (in Java chars) of the annotation in the original text, inclusive. |
| int | [hashCode](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#hashCode())() Returns a hash code value for the object. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#toString())() Returns a string represents `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation`. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) o)

Indicates whether some other object is "equal to" this one.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getAnnotatedText** ()

The text segment within the original text that this annotation refers to (from the
start index returned by `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart()` to the end index returned by `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd()`, exclusively).

#### public int **getEnd** ()

The end index (in Java chars) of the annotation in the original text, exclusive.

#### public [List](https://developer.android.com/reference/java/util/List.html)\<[Entity](https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/Entity)\>
**getEntities** ()

A list of possible entities that this annotation could refer to. It has at least one
entity and order is non-deterministic.

#### public int **getStart** ()

The start index (in Java chars) of the annotation in the original text,
inclusive.

#### public int **hashCode** ()

Returns a hash code value for the object.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()

Returns a string represents `https://developers.google.com/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation`.