# TextSelection

Artifact: [androidx.pdf:pdf-core](https://developer.android.com/jetpack/androidx/releases/pdf) [View Source](https://cs.android.com/search?q=file:androidx/pdf/selection/model/TextSelection.kt+class:androidx.pdf.selection.model.TextSelection) Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

*** ** * ** ***


```
public final class TextSelection implements Selection
```

<br />

*** ** * ** ***

Represents text content that has been selected.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/pdf/selection/model/TextSelection#TextSelection(kotlin.CharSequence,kotlin.collections.List)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html text, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/PdfRect> bounds )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/pdf/selection/model/TextSelection#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/pdf/PdfRect>` | `https://developer.android.com/reference/androidx/pdf/selection/model/TextSelection#getBounds()()` The bounding rectangles of the selected text. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/pdf/selection/model/TextSelection#getText()()` The selected text. |
| `int` | `https://developer.android.com/reference/androidx/pdf/selection/model/TextSelection#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/pdf/selection/model/TextSelection#toString()()` |

## Public constructors

### TextSelection

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
public TextSelection(
    @NonNull CharSequence text,
    @NonNull List<@NonNull PdfRect> bounds
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getBounds

```
public @NonNull List<@NonNull PdfRect> getBounds()
```

The bounding rectangles of the selected text.

### getText

Added in [1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/pdf#1.0.0-beta01)

```
public final @NonNull CharSequence getText()
```

The selected text.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```