# OutOfRange

Artifact: [androidx.ink:ink-brush](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/brush/behavior/OutOfRange.kt+class:androidx.ink.brush.behavior.OutOfRange) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

*** ** * ** ***


```
public final class OutOfRange
```

<br />

*** ** * ** ***

The desired behavior when an input value is outside the range defined by `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeStart()` and `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeEnd()`.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange` | `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#CLAMP()` Values outside the range will be clamped to not exceed the bounds. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange` | `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#MIRROR()` Similar to `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#REPEAT()`, but every other repetition of the bounds will be mirrored, as though `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeStart()` and `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeEnd()` were swapped. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange` | `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#REPEAT()` Values will be shifted by an integer multiple of the range size so that they fall within the bounds. |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/Version` | `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#calculateMinimumRequiredVersion()()` Returns the minimum required `https://developer.android.com/reference/androidx/ink/brush/Version` for this `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#toString()()` |

## Public fields

### CLAMP

```
public static final @NonNull OutOfRange CLAMP
```

Values outside the range will be clamped to not exceed the bounds.

### MIRROR

```
public static final @NonNull OutOfRange MIRROR
```

Similar to `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#REPEAT()`, but every other repetition of the bounds will be mirrored, as though `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeStart()` and `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeEnd()` were swapped. This means the range does not need to be treated as a half-open interval like in the case of `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange#REPEAT()`.

### REPEAT

```
public static final @NonNull OutOfRange REPEAT
```

Values will be shifted by an integer multiple of the range size so that they fall within the bounds.

In this case, the range will be treated as a half-open interval, with a value exactly at `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeEnd()` being treated as though it was `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#sourceValueRangeStart()`.

## Public methods

### calculateMinimumRequiredVersion

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

```
public final @NonNull Version calculateMinimumRequiredVersion()
```

Returns the minimum required `https://developer.android.com/reference/androidx/ink/brush/Version` for this `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange`.

By default, decoding a `https://developer.android.com/reference/androidx/ink/brush/BrushFamily` containing an `https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange` with a minimum required version higher than `https://developer.android.com/reference/androidx/ink/brush/Version#MAX_SUPPORTED()` will fail.

### toString

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