# SearchResult.MatchRange

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/SearchResult.java+class:androidx.appsearch.app.SearchResult.MatchRange) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class SearchResult.MatchRange
```

<br />

*** ** * ** ***

Class providing the position range of a text match information.

All ranges are finite, and the left side of the range is always `<=` the right side of the range.

Example: MatchRange(0, 100) represents hundred ints from 0 to 99."

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange#MatchRange(int,int)(int start, int end)` Creates a new immutable range. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html other)` |
| `int` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange#getEnd()()` Gets the end point (exclusive). |
| `int` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange#getStart()()` Gets the start point (inclusive). |
| `int` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/app/SearchResult.MatchRange#toString()()` |

## Public constructors

### MatchRange

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public MatchRange(int start, int end)
```

Creates a new immutable range.

The endpoints are `[start, end)`; that is the range is bounded. `start` must be lesser or equal to `end`.

| Parameters |
|---|---|
| `int start` | The start point (inclusive) |
| `int end` | The end point (exclusive) |

## Public methods

### equals

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

### getEnd

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public int getEnd()
```

Gets the end point (exclusive).

### getStart

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public int getStart()
```

Gets the start point (inclusive).

### hashCode

```
public int hashCode()
```

### toString

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