# ImmutableStrokeInputBatch

Artifact: [androidx.ink:ink-strokes](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/strokes/StrokeInputBatch.kt+class:androidx.ink.strokes.ImmutableStrokeInputBatch) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
public final class ImmutableStrokeInputBatch extends StrokeInputBatch
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.ink.strokes.StrokeInputBatch](https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch) ||
|   | ↳ | [androidx.ink.strokes.ImmutableStrokeInputBatch](https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch) |

*** ** * ** ***

An immutable implementation of `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch`. For a mutable alternative, see `https://developer.android.com/reference/androidx/ink/strokes/MutableStrokeInputBatch`.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch` | `https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch#EMPTY()` An empty `https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch`. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch` | `https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch#toImmutable()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch#toString()()` |

### Inherited methods

From [androidx.ink.strokes.StrokeInputBatch](https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch) `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/StrokeInput` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#get(kotlin.Int)(int index)`

Gets the value of the i-th input.
`final @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0, toInclusive = false) float` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#getBasePaintAnimationPhase()()`

Returns the \[0, 1) value that will determine the stroke's overall paint animation progress at some arbitrary zero clock state, so that different strokes can be animated correctly relative to each other.
`final long` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#getDurationMillis()()`

The duration between the first and last input in milliseconds.
`final int` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#getNoiseSeed()()`

Returns the seed value that should be used for seeding any noise generators for brush behaviors when a full stroke is regenerated with this input batch.
`final int` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#getSize()()`

Number of `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput` objects in the batch.
`final float` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#getStrokeUnitLengthCm()()`

The physical distance in centimeters that the pointer must travel in order to produce an input motion of one stroke unit.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/InputToolType` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#getToolType()()`

How this input stream should be interpreted, as coming from a `https://developer.android.com/reference/androidx/ink/brush/InputToolType#MOUSE()`, `https://developer.android.com/reference/androidx/ink/brush/InputToolType#TOUCH()`, or `https://developer.android.com/reference/androidx/ink/brush/InputToolType#STYLUS()`.
`final boolean` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#hasOrientation()()`

Whether all of the individual inputs have a defined value for `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput#orientationRadians()`.
`final boolean` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#hasPressure()()`

Whether all of the individual inputs have a defined value for `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput#pressure()`.
`final boolean` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#hasStrokeUnitLength()()`

Whether `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput#strokeUnitLengthCm()` has a valid value, which is something other than `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput#NO_STROKE_UNIT_LENGTH()`.
`final boolean` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#hasTilt()()`

Whether all of the individual inputs have a defined value for `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput#tiltRadians()`.
`final boolean` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#isEmpty()()`

`true` if there are no `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput` objects in the batch, and `false` otherwise.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/StrokeInput` `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#populate(kotlin.Int,androidx.ink.strokes.StrokeInput)(int index, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/StrokeInput outStrokeInput)`

Gets the value of the i-th input and overwrites `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch#populate(kotlin.Int,androidx.ink.strokes.StrokeInput)`, which it then returns.

## Public fields

### EMPTY

```
public static final @NonNull ImmutableStrokeInputBatch EMPTY
```

An empty `https://developer.android.com/reference/androidx/ink/strokes/ImmutableStrokeInputBatch`.

## Public methods

### toImmutable

```
public @NonNull ImmutableStrokeInputBatch toImmutable()
```

### toString

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