ImmutableStrokeInputBatch


public final class ImmutableStrokeInputBatch extends StrokeInputBatch


An immutable implementation of StrokeInputBatch. For a mutable alternative, see MutableStrokeInputBatch.

Summary

Public fields

static final @NonNull ImmutableStrokeInputBatch

An empty ImmutableStrokeInputBatch.

Public methods

@NonNull String

Inherited methods

From androidx.ink.strokes.StrokeInputBatch
final void
final @NonNull StrokeInput
get(int index)

Gets the value of the i-th input.

final long

The duration between the first and last input in milliseconds.

final int

Number of StrokeInput objects in the batch.

final float

The physical distance in centimeters that the pointer must travel in order to produce an input motion of one stroke unit.

final @NonNull InputToolType

How this input stream should be interpreted, as coming from a InputToolType.MOUSE, InputToolType.TOUCH, or InputToolType.STYLUS.

final boolean

Whether all of the individual inputs have a defined value for StrokeInput.orientationRadians.

final boolean

Whether all of the individual inputs have a defined value for StrokeInput.pressure.

final boolean

Whether strokeUnitLengthCm has a valid value, which is something other than StrokeInput.NO_STROKE_UNIT_LENGTH.

final boolean

Whether all of the individual inputs have a defined value for StrokeInput.tiltRadians.

final boolean

true if there are no StrokeInput objects in the batch, and false otherwise.

final @NonNull StrokeInput
populate(int index, @NonNull StrokeInput outStrokeInput)

Gets the value of the i-th input and overwrites outStrokeInput, which it then returns.

Public fields

EMPTY

public static final @NonNull ImmutableStrokeInputBatch EMPTY

An empty ImmutableStrokeInputBatch.

Public methods

toString

public @NonNull String toString()