# BinaryOpNode.BinaryOp

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

*** ** * ** ***

Common/All
- Cmn

  ```
  class BinaryOpNode.BinaryOp
  ```

*** ** * ** ***

A binary operation for combining two values in a `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode`. Unless otherwise specified for a particular operator, the result will be null (i.e. undefined) if either input value is null.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#AND_THEN()` Evaluates to null if the first input is null, otherwise evaluates to the second input. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#MAX()` Evaluates to the max of the two input values. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#MIN()` Evaluates to the min of the two input values. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#OR_ELSE()` Evaluates to first input if it's not null, otherwise evaluates to the second input. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#PRODUCT()` Evaluates to the product of the two input values. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#SUM()` Evaluates to the sum of the two input values. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#XOR_ELSE()` If exactly one input isn't null, evaluates to that one, otherwise evaluates to null. | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#calculateMinimumRequiredVersion()()` Returns the minimum required `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp`. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/behavior/BinaryOpNode.BinaryOp#toString()()` | Cmn |

## Public companion properties

### AND_THEN

Cmn

```
val AND_THEN: BinaryOpNode.BinaryOp
```

Evaluates to null if the first input is null, otherwise evaluates to the second input.

### MAX

Cmn

```
val MAX: BinaryOpNode.BinaryOp
```

Evaluates to the max of the two input values.

### MIN

Cmn

```
val MIN: BinaryOpNode.BinaryOp
```

Evaluates to the min of the two input values.

### OR_ELSE

Cmn

```
val OR_ELSE: BinaryOpNode.BinaryOp
```

Evaluates to first input if it's not null, otherwise evaluates to the second input.

### PRODUCT

Cmn

```
val PRODUCT: BinaryOpNode.BinaryOp
```

Evaluates to the product of the two input values.

### SUM

Cmn

```
val SUM: BinaryOpNode.BinaryOp
```

Evaluates to the sum of the two input values.

### XOR_ELSE

Cmn

```
val XOR_ELSE: BinaryOpNode.BinaryOp
```

If exactly one input isn't null, evaluates to that one, otherwise evaluates to null.

## Public functions

### calculateMinimumRequiredVersion

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

```
fun calculateMinimumRequiredVersion(): Version
```

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

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

### toString

Cmn

```
open fun toString(): String
```