Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#nestedclasses) \| [Constants](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#constants) \| [Ctors](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#inhmethods)

# AccessibilityNodeInfo.CollectionInfo

*** ** * ** ***

` public static final class AccessibilityNodeInfo.CollectionInfo `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.accessibility.AccessibilityNodeInfo.CollectionInfo |

<br />

*** ** * ** ***

Class with information if a node is a collection.

A collection of items has rows and columns and may be hierarchical. For example, a horizontal list is a collection with one column, as many rows as the list items, and is not hierarchical; A table is a collection with several rows, several columns, and is not hierarchical; A vertical tree is a hierarchical collection with one column and as many rows as the first level children.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo.Builder` The builder for CollectionInfo. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_MULTIPLE` Selection mode where multiple items may be selected. |
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_NONE` Selection mode where items are not selectable. |
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_SINGLE` Selection mode where a single item may be selected. |
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#UNDEFINED` Constant to denote a missing collection count. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#CollectionInfo(int,%20int,%20boolean)(int rowCount, int columnCount, boolean hierarchical) ` Creates a new instance. |
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#CollectionInfo(int,%20int,%20boolean,%20int)(int rowCount, int columnCount, boolean hierarchical, int selectionMode) ` Creates a new instance. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#getColumnCount()() ` Gets the number of columns. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#getImportantForAccessibilityItemCount()() ` Gets the number of items in the collection considered important for accessibility. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#getItemCount()() ` Gets the number of items in the collection. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#getRowCount()() ` Gets the number of rows. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#getSelectionMode()() ` Gets the collection's selection mode. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#isHierarchical()() ` Gets if the collection is a hierarchically ordered. |
| ` static https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#obtain(int,%20int,%20boolean,%20int)(int rowCount, int columnCount, boolean hierarchical, int selectionMode) ` *This method was deprecated in API level 33. Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#CollectionInfo(int,%20int,%20boolean,%20int)` instead.* |
| ` static https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#obtain(int,%20int,%20boolean)(int rowCount, int columnCount, boolean hierarchical) ` *This method was deprecated in API level 33. Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#CollectionInfo(int,%20int,%20boolean)` instead.* |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` 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 https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` 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` ` 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` ` 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*.

## Constants

### SELECTION_MODE_MULTIPLE

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

```
public static final int SELECTION_MODE_MULTIPLE
```

Selection mode where multiple items may be selected.

<br />

Constant Value: 2 (0x00000002)

### SELECTION_MODE_NONE

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

```
public static final int SELECTION_MODE_NONE
```

Selection mode where items are not selectable.

<br />

Constant Value: 0 (0x00000000)

### SELECTION_MODE_SINGLE

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

```
public static final int SELECTION_MODE_SINGLE
```

Selection mode where a single item may be selected.

<br />

Constant Value: 1 (0x00000001)

### UNDEFINED

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

```
public static final int UNDEFINED
```

Constant to denote a missing collection count. This should be used for `mItemCount` and `mImportantForAccessibilityItemCount` when values for those fields are not known.

<br />

Constant Value: -1 (0xffffffff)

## Public constructors

### CollectionInfo

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

```
public CollectionInfo (int rowCount, 
                int columnCount, 
                boolean hierarchical)
```

Creates a new instance.

<br />

| Parameters ||
|---|---|
| `rowCount` | `int`: The number of rows. <br /> |
| `columnCount` | `int`: The number of columns. <br /> |
| `hierarchical` | `boolean`: Whether the collection is hierarchical. <br /> |

### CollectionInfo

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

```
public CollectionInfo (int rowCount, 
                int columnCount, 
                boolean hierarchical, 
                int selectionMode)
```

Creates a new instance.

<br />

| Parameters ||
|---|---|
| `rowCount` | `int`: The number of rows. <br /> |
| `columnCount` | `int`: The number of columns. <br /> |
| `hierarchical` | `boolean`: Whether the collection is hierarchical. <br /> |
| `selectionMode` | `int`: The collection's selection mode. <br /> |

## Public methods

### getColumnCount

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

```
public int getColumnCount ()
```

Gets the number of columns.

<br />

| Returns ||
|---|---|
| `int` | The column count, or -1 if count is unknown. <br /> |

### getImportantForAccessibilityItemCount

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

```
public int getImportantForAccessibilityItemCount ()
```

Gets the number of items in the collection considered important for accessibility.

<br />

| Returns ||
|---|---|
| `int` | The count of items important for accessibility, which may be `UNDEFINED` if the count is not known. <br /> |

### getItemCount

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

```
public int getItemCount ()
```

Gets the number of items in the collection.

<br />

| Returns ||
|---|---|
| `int` | The count of items, which may be `UNDEFINED` if the count is not known. <br /> |

### getRowCount

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

```
public int getRowCount ()
```

Gets the number of rows.

<br />

| Returns ||
|---|---|
| `int` | The row count, or -1 if count is unknown. <br /> |

### getSelectionMode

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

```
public int getSelectionMode ()
```

Gets the collection's selection mode.

<br />

| Returns ||
|---|---|
| `int` | The collection's selection mode, one of: - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_NONE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_SINGLE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_MULTIPLE` <br /> |

### isHierarchical

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

```
public boolean isHierarchical ()
```

Gets if the collection is a hierarchically ordered.

<br />

| Returns ||
|---|---|
| `boolean` | Whether the collection is hierarchical. <br /> |

### obtain

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

```
public static AccessibilityNodeInfo.CollectionInfo obtain (int rowCount, 
                int columnCount, 
                boolean hierarchical, 
                int selectionMode)
```

<br />

**This method was deprecated in API level 33.**   

Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#CollectionInfo(int,%20int,%20boolean,%20int)` instead.

Obtains a pooled instance.

<br />

| Parameters ||
|---|---|
| `rowCount` | `int`: The number of rows. <br /> |
| `columnCount` | `int`: The number of columns. <br /> |
| `hierarchical` | `boolean`: Whether the collection is hierarchical. <br /> |
| `selectionMode` | `int`: The collection's selection mode, one of: - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_NONE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_SINGLE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#SELECTION_MODE_MULTIPLE` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo` | <br /> |

### obtain

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

```
public static AccessibilityNodeInfo.CollectionInfo obtain (int rowCount, 
                int columnCount, 
                boolean hierarchical)
```

<br />

**This method was deprecated in API level 33.**   

Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo#CollectionInfo(int,%20int,%20boolean)` instead.

Obtains a pooled instance.

<br />

| Parameters ||
|---|---|
| `rowCount` | `int`: The number of rows, or -1 if count is unknown. <br /> |
| `columnCount` | `int`: The number of columns, or -1 if count is unknown. <br /> |
| `hierarchical` | `boolean`: Whether the collection is hierarchical. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionInfo` | <br /> |