# OptionalContentOrderArray Class

> Array node class for items in the OptionalContentConfig Order array.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderArray
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/llms.txt

```java
class OptionalContentOrderArray : OptionalContentOrderNode
```

**Namespace:** `com::datalogics::PDFL`

**Inherits from:** [`OptionalContentOrderNode`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderNode.md)

## Description

Array node class for items in the OptionalContentConfig Order array. Items in the Order array can be arranged into a tree structure; subarrays within the parent array form 'branches' of the tree. Each OptionalContentOrderArray may contain OptionalContentOrderLeafs or OptionalContentOrderArrays in a specific order; this order determines how they will appear in the 'Layers' control of the viewer.

By placing OptionalContentOrderArrays into a higher-level array, branches can be added to the tree. The 'Title' property is a string that will appear next to the expand/collapse branch control in a PDF Viewer 'Layers' panel.

**Referenced by:** [`OptionalContentConfig`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentConfig.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md), [`OptionalContentOrderNode`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderNode.md)

## Constructors

### OptionalContentOrderArray

```java
com.datalogics.PDFL.OptionalContentOrderArray.OptionalContentOrderArray(Document doc)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): The Document this OptionalContentOrderArray is being created in

Create an OptionalContentOrderArray with no title.

### OptionalContentOrderArray

```java
com.datalogics.PDFL.OptionalContentOrderArray.OptionalContentOrderArray(Document doc, String title)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): The Document this OptionalContentOrderArray is being created in
- `title` (`String`): The string which will appear in the Layer control panel

Create an OptionalContentOrderArray with a title.

## Methods

### add

```java
void com.datalogics.PDFL.OptionalContentOrderArray.add(OptionalContentOrderNode node)
```

**Parameters**

- `node` ([`OptionalContentOrderNode`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderNode.md)): The OptionalContentOrderNode to append to the Array

**Returns:** `void`

Adds an OptionalContentOrderNode to the end of the Array.

### delete

```java
synchronized void com.datalogics.PDFL.OptionalContentOrderArray.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.OptionalContentOrderArray.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.OptionalContentOrderArray.finalize()
```

*protected*

**Returns:** `void`

### get

```java
OptionalContentOrderNode com.datalogics.PDFL.OptionalContentOrderArray.get(int index)
```

**Parameters**

- `index` (`int`): The index at which to fetch an OptionalContentOrderNode.

**Returns:** [`OptionalContentOrderNode`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderNode.md)

An OptionalContentOrderNode, or null if there is nothing at that index.

Returns the OptionalContentOrderNode at the given index.

### getLength

```java
int com.datalogics.PDFL.OptionalContentOrderArray.getLength()
```

**Returns:** `int`

The number of nodes in this array.

Gets the number of OptionalContentOrderNodes in this array.

### getTitle

```java
String com.datalogics.PDFL.OptionalContentOrderArray.getTitle()
```

**Returns:** `String`

The title string of this OptionalContentOrderArray, or NULL if no title is set.

Gets the title string of this Array. This title will appear next to the expand/collapse control in the 'Layers' panel of a PDF Viewer.

### insert

```java
void com.datalogics.PDFL.OptionalContentOrderArray.insert(int index, OptionalContentOrderNode node)
```

**Parameters**

- `index` (`int`): The index at which to insert the Node
- `node` ([`OptionalContentOrderNode`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderNode.md)): The OptionalContentOrderNode to insert in the Array

**Returns:** `void`

Inserts an OptionalContentOrderNode at the given index, displacing existing objects. All objects following this will have their index increased by one.

### put

```java
void com.datalogics.PDFL.OptionalContentOrderArray.put(int index, OptionalContentOrderNode node)
```

**Parameters**

- `index` (`int`): The index at which to replace the existing Node
- `node` ([`OptionalContentOrderNode`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderNode.md)): The OptionalContentOrderNode to place in the Array

**Returns:** `void`

Puts an OptionalContentOrderNode at the given index, replacing the existing item. The index can be greater than the current length of the array; the array will be extended and the empty slots filled with null objects.

### removeAt

```java
void com.datalogics.PDFL.OptionalContentOrderArray.removeAt(int index)
```

**Parameters**

- `index` (`int`): The index of the OptionalContentOrderNode to remove

**Returns:** `void`

Removes the OptionalContentOrderNode at the given index. The length of the array is reduced by 1.

### setTitle

```java
void com.datalogics.PDFL.OptionalContentOrderArray.setTitle(String title)
```

**Parameters**

- `title` (`String`): The title string of this OptionalContentOrderArray, or NULL to remove the title.

**Returns:** `void`

Sets the title string of this Array. This title will appear next to the expand/collapse control in the 'Layers' panel of a PDF Viewer. This field may be set to NULL to remove the title.
