# SourceNode

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/SourceNode.kt+class:androidx.ink.brush.behavior.SourceNode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

*** ** * ** ***


```
public final class SourceNode extends ValueNode
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.ink.brush.behavior.Node](https://developer.android.com/reference/androidx/ink/brush/behavior/Node) |||
|   | ↳ | [androidx.ink.brush.behavior.ValueNode](https://developer.android.com/reference/androidx/ink/brush/behavior/ValueNode) ||
|   |   | ↳ | [androidx.ink.brush.behavior.SourceNode](https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode) |

*** ** * ** ***

A `https://developer.android.com/reference/androidx/ink/brush/behavior/ValueNode` that gets data from the stroke input batch.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode.Source` List of input properties along with their units that can act as sources for a `https://developer.android.com/reference/androidx/ink/brush/BrushBehavior`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#SourceNode(androidx.ink.brush.behavior.SourceNode.Source,kotlin.Float,kotlin.Float,androidx.ink.brush.behavior.OutOfRange)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode.Source source, float sourceValueRangeStart, float sourceValueRangeEnd, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange sourceOutOfRangeBehavior )` Creates a `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode` that gets data from the stroke inputs. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode.Source` | `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#getSource()()` The property of the data to get values from. |
| `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/SourceNode#getSourceOutOfRangeBehavior()()` The behavior to use if the source produces a value outside the specified range. |
| `final float` | `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#getSourceValueRangeEnd()()` The end of the range of values that the source can produce. |
| `final float` | `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#getSourceValueRangeStart()()` The start of the range of values that the source can produce. |
| `int` | `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#hashCode()()` |
| `@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/SourceNode#toString()()` |

### Inherited methods

From [androidx.ink.brush.behavior.Node](https://developer.android.com/reference/androidx/ink/brush/behavior/Node) `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/Node#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/Node`.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/ValueNode>` `https://developer.android.com/reference/androidx/ink/brush/behavior/Node#getInputs()()`

The ordered list of inputs that this node directly depends on.

## Public constructors

### SourceNode

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

```
public SourceNode(
    @NonNull SourceNode.Source source,
    float sourceValueRangeStart,
    float sourceValueRangeEnd,
    @NonNull OutOfRange sourceOutOfRangeBehavior
)
```

Creates a `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode` that gets data from the stroke inputs.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode.Source source` | the property of the data to get values from |
| `float sourceValueRangeStart` | the start of the range of values that the source can produce. Must be finite and distinct from `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#(androidx.ink.brush.behavior.SourceNode.Source,kotlin.Float,kotlin.Float,androidx.ink.brush.behavior.OutOfRange)` |
| `float sourceValueRangeEnd` | the end of the range of values that the source can produce. Must be finite and distinct from `https://developer.android.com/reference/androidx/ink/brush/behavior/SourceNode#(androidx.ink.brush.behavior.SourceNode.Source,kotlin.Float,kotlin.Float,androidx.ink.brush.behavior.OutOfRange)` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/brush/behavior/OutOfRange sourceOutOfRangeBehavior` | the behavior to use if the source produces a value outside the specified range |

## Public methods

### equals

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

### getSource

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

```
public final @NonNull SourceNode.Source getSource()
```

The property of the data to get values from.

### getSourceOutOfRangeBehavior

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

```
public final @NonNull OutOfRange getSourceOutOfRangeBehavior()
```

The behavior to use if the source produces a value outside the specified range.

### getSourceValueRangeEnd

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

```
public final float getSourceValueRangeEnd()
```

The end of the range of values that the source can produce.

### getSourceValueRangeStart

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

```
public final float getSourceValueRangeStart()
```

The start of the range of values that the source can produce.

### hashCode

```
public int hashCode()
```

### toString

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