OutOfRange


public final class OutOfRange


The desired behavior when an input value is outside the range defined by SourceNode.sourceValueRangeStart and SourceNode.sourceValueRangeEnd.

Summary

Public fields

static final @NonNull OutOfRange

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

static final @NonNull OutOfRange

Similar to REPEAT, but every other repetition of the bounds will be mirrored, as though SourceNode.sourceValueRangeStart and SourceNode.sourceValueRangeEnd were swapped.

static final @NonNull OutOfRange

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

Public methods

final @NonNull Version

Returns the minimum required Version for this OutOfRange.

@NonNull String

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 REPEAT, but every other repetition of the bounds will be mirrored, as though SourceNode.sourceValueRangeStart and SourceNode.sourceValueRangeEnd were swapped. This means the range does not need to be treated as a half-open interval like in the case of 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 SourceNode.sourceValueRangeEnd being treated as though it was SourceNode.sourceValueRangeStart.

Public methods

calculateMinimumRequiredVersion

Added in 1.1.0-alpha06
public final @NonNull Version calculateMinimumRequiredVersion()

Returns the minimum required Version for this OutOfRange.

By default, decoding a androidx.ink.brush.BrushFamily containing an OutOfRange with a minimum required version higher than Version.MAX_SUPPORTED will fail.

toString

public @NonNull String toString()