# ScriptGroup.Builder

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#inhmethods)  

# ScriptGroup.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/renderscript/ScriptGroup.Builder "View this page in Kotlin")\|Java

`
public
static
final

class
ScriptGroup.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.renderscript.ScriptGroup.Builder |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 23.**   
Use[Builder2](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder2)instead.

Helper class to build a ScriptGroup. A ScriptGroup is created in two steps.

First, all kernels to be used by the ScriptGroup should be added.

Second, add connections between kernels. There are two types of connections: kernel to kernel and kernel to field. Kernel to kernel allows a kernel's output to be passed to another kernel as input. Kernel to field allows the output of one kernel to be bound as a script global. Kernel to kernel is higher performance and should be used where possible.

A ScriptGroup must contain a single directed acyclic graph (DAG); it cannot contain cycles. Currently, all kernels used in a ScriptGroup must come from different Script objects. Additionally, all kernels in a ScriptGroup must have at least one input, output, or internal connection.

Once all connections are made, a call to[create()](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#create())will return the ScriptGroup object.

## Summary

|                                                                                                                                    ### Public constructors                                                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#Builder(android.renderscript.RenderScript))`(`[RenderScript](https://developer.android.com/reference/android/renderscript/RenderScript)` rs) ` Create a Builder for generating a ScriptGroup. |

|                                                                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                                                                             ||
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[ScriptGroup.Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder) | ` `[addConnection](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#addConnection(android.renderscript.Type,%20android.renderscript.Script.KernelID,%20android.renderscript.Script.FieldID))`(`[Type](https://developer.android.com/reference/android/renderscript/Type)` t, `[Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID)` from, `[Script.FieldID](https://developer.android.com/reference/android/renderscript/Script.FieldID)` to) ` Adds a connection to the group.    |
| ` `[ScriptGroup.Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder) | ` `[addConnection](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#addConnection(android.renderscript.Type,%20android.renderscript.Script.KernelID,%20android.renderscript.Script.KernelID))`(`[Type](https://developer.android.com/reference/android/renderscript/Type)` t, `[Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID)` from, `[Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID)` to) ` Adds a connection to the group. |
| ` `[ScriptGroup.Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder) | ` `[addKernel](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#addKernel(android.renderscript.Script.KernelID))`(`[Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID)` k) ` Adds a Kernel to the group.                                                                                                                                                                                                                                                                          |
| ` `[ScriptGroup](https://developer.android.com/reference/android/renderscript/ScriptGroup)                 | ` `[create](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder#create())`() ` Creates the Script group.                                                                                                                                                                                                                                                                                                                                                                                                                         |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Builder (RenderScript rs)
```

Create a Builder for generating a ScriptGroup.

<br />

|                       Parameters                       ||
|------|--------------------------------------------------|
| `rs` | `RenderScript`: The RenderScript context. <br /> |

## Public methods

### addConnection

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ScriptGroup.Builder addConnection (Type t, 
                Script.KernelID from, 
                Script.FieldID to)
```

Adds a connection to the group.

<br />

|                                                                 Parameters                                                                  ||
|--------|-------------------------------------------------------------------------------------------------------------------------------------|
| `t`    | `Type`: The type of the connection. This is used to determine the kernel launch sizes on the source side of this connection. <br /> |
| `from` | `Script.KernelID`: The source for the connection. <br />                                                                            |
| `to`   | `Script.FieldID`: The destination of the connection. <br />                                                                         |

|                                                               Returns                                                                ||
|---------------------------------------------------------------------------------------------------------|-----------------------------|
| [ScriptGroup.Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder) | Builder Returns this <br /> |

### addConnection

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ScriptGroup.Builder addConnection (Type t, 
                Script.KernelID from, 
                Script.KernelID to)
```

Adds a connection to the group.

<br />

|                                                               Parameters                                                                ||
|--------|---------------------------------------------------------------------------------------------------------------------------------|
| `t`    | `Type`: The type of the connection. This is used to determine the kernel launch sizes for both sides of this connection. <br /> |
| `from` | `Script.KernelID`: The source for the connection. <br />                                                                        |
| `to`   | `Script.KernelID`: The destination of the connection. <br />                                                                    |

|                                                               Returns                                                                ||
|---------------------------------------------------------------------------------------------------------|-----------------------------|
| [ScriptGroup.Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder) | Builder Returns this <br /> |

### addKernel

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ScriptGroup.Builder addKernel (Script.KernelID k)
```

Adds a Kernel to the group.

<br />

|                    Parameters                     ||
|-----|----------------------------------------------|
| `k` | `Script.KernelID`: The kernel to add. <br /> |

|                                                                Returns                                                                ||
|---------------------------------------------------------------------------------------------------------|------------------------------|
| [ScriptGroup.Builder](https://developer.android.com/reference/android/renderscript/ScriptGroup.Builder) | Builder Returns this. <br /> |

### create

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ScriptGroup create ()
```

Creates the Script group.

<br />

|                                                             Returns                                                             ||
|-----------------------------------------------------------------------------------------|----------------------------------------|
| [ScriptGroup](https://developer.android.com/reference/android/renderscript/ScriptGroup) | ScriptGroup The new ScriptGroup <br /> |