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.CollectionItemInfo#nestedclasses) \| [Constants](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#constants) \| [Ctors](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#inhmethods)

# AccessibilityNodeInfo.CollectionItemInfo

*** ** * ** ***


`
public
static
final

class
AccessibilityNodeInfo.CollectionItemInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

Class with information if a node is a collection item.


A collection item is contained in a collection, it starts at
a given row and column in the collection, and spans one or
more rows and columns. For example, a header of two related
table columns starts at the first row and the first column,
spans one row and two columns.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo.Builder` Builder for creating `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo` objects. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_ASCENDING` Items are sorted in ascending order (e.g., A-Z, 0-9). |
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_DESCENDING` Items are sorted in descending order (e.g., Z-A, 9-0). |
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_NONE` There is no sort direction. |
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_OTHER` Items are sorted, but using a method other than ascending or descending (e.g., based on relevance or a custom algorithm). |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#CollectionItemInfo(int,%20int,%20int,%20int,%20boolean)(int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) ` Creates a new instance. |
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#CollectionItemInfo(int,%20int,%20int,%20int,%20boolean,%20boolean)(int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading, boolean selected) ` Creates a new instance. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getColumnIndex()() ` Gets the column index at which the item is located. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getColumnSpan()() ` Gets the number of columns the item spans. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getColumnTitle()() ` Gets the column title at which the item is located. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getRowIndex()() ` Gets the row index at which the item is located. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getRowSpan()() ` Gets the number of rows the item spans. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getRowTitle()() ` Gets the row title at which the item is located. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getSortDirection()() ` Gets the sort direction applied to the data associated with this node. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#isHeading()() ` *This method was deprecated in API level 28. Use `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#isHeading()`* |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#isSelected()() ` Gets if the collection item is selected. |
| ` static https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#obtain(int,%20int,%20int,%20int,%20boolean)(int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) ` *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.CollectionItemInfo#CollectionItemInfo(int,%20int,%20int,%20int,%20boolean)` instead.* |
| ` static https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#obtain(int,%20int,%20int,%20int,%20boolean,%20boolean)(int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading, boolean selected) ` *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.CollectionItemInfo#CollectionItemInfo(int,%20int,%20int,%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

### SORT_DIRECTION_ASCENDING

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int SORT_DIRECTION_ASCENDING
```

Items are sorted in ascending order (e.g., A-Z, 0-9).

<br />

**See also:**

- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getSortDirection()`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo.Builder#setSortDirection(int)`

Constant Value:

1
(0x00000001)


### SORT_DIRECTION_DESCENDING

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int SORT_DIRECTION_DESCENDING
```

Items are sorted in descending order (e.g., Z-A, 9-0).

<br />

**See also:**

- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getSortDirection()`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo.Builder#setSortDirection(int)`

Constant Value:

2
(0x00000002)


### SORT_DIRECTION_NONE

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int SORT_DIRECTION_NONE
```

There is no sort direction.

<br />

**See also:**

- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getSortDirection()`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo.Builder#setSortDirection(int)`

Constant Value:

0
(0x00000000)


### SORT_DIRECTION_OTHER

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int SORT_DIRECTION_OTHER
```

Items are sorted, but using a method other than ascending
or descending (e.g., based on relevance or a custom algorithm).

<br />

**See also:**

- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#getSortDirection()`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo.Builder#setSortDirection(int)`

Constant Value:

3
(0x00000003)


## Public constructors

### CollectionItemInfo

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

```
public CollectionItemInfo (int rowIndex, 
                int rowSpan, 
                int columnIndex, 
                int columnSpan, 
                boolean heading)
```

Creates a new instance.

<br />

| Parameters ||
|---|---|
| `rowIndex` | `int`: The row index at which the item is located. <br /> |
| `rowSpan` | `int`: The number of rows the item spans. <br /> |
| `columnIndex` | `int`: The column index at which the item is located. <br /> |
| `columnSpan` | `int`: The number of columns the item spans. <br /> |
| `heading` | `boolean`: Whether the item is a heading. <br /> |

### CollectionItemInfo

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

```
public CollectionItemInfo (int rowIndex, 
                int rowSpan, 
                int columnIndex, 
                int columnSpan, 
                boolean heading, 
                boolean selected)
```

Creates a new instance.

<br />

| Parameters ||
|---|---|
| `rowIndex` | `int`: The row index at which the item is located. <br /> |
| `rowSpan` | `int`: The number of rows the item spans. <br /> |
| `columnIndex` | `int`: The column index at which the item is located. <br /> |
| `columnSpan` | `int`: The number of columns the item spans. <br /> |
| `heading` | `boolean`: Whether the item is a heading. <br /> |
| `selected` | `boolean`: Whether the item is selected. <br /> |

## Public methods

### getColumnIndex

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

```
public int getColumnIndex ()
```

Gets the column index at which the item is located.

<br />

| Returns ||
|---|---|
| `int` | The column index. <br /> |

### getColumnSpan

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

```
public int getColumnSpan ()
```

Gets the number of columns the item spans.

<br />

| Returns ||
|---|---|
| `int` | The column span. <br /> |

### getColumnTitle

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

```
public String getColumnTitle ()
```

Gets the column title at which the item is located.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The column title. This value may be `null`. <br /> |

### getRowIndex

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

```
public int getRowIndex ()
```

Gets the row index at which the item is located.

<br />

| Returns ||
|---|---|
| `int` | The row index. <br /> |

### getRowSpan

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

```
public int getRowSpan ()
```

Gets the number of rows the item spans.

<br />

| Returns ||
|---|---|
| `int` | The row span. <br /> |

### getRowTitle

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

```
public String getRowTitle ()
```

Gets the row title at which the item is located.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The row title. This value may be `null`. <br /> |

### getSortDirection

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int getSortDirection ()
```

Gets the sort direction applied to the data associated with this
node.


This item can only be set on a heading node within a table collection.
Given the heading node's collection item, a subsequent collection item uses this sort
direction if it has the same row or column index, and a greater index in the other
dimension. For example, an item at row 2, column 2 can reference a heading at row 2,
column 1 for its sort direction.

<br />

| Returns ||
|---|---|
| `int` | The current sort direction, one of: - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_NONE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_ASCENDING` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_DESCENDING` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_OTHER` . Value is one of the following: - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_NONE` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_ASCENDING` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_DESCENDING` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo#SORT_DIRECTION_OTHER` |

### isHeading

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

```
public boolean isHeading ()
```


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

Use `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#isHeading()`

Gets if the collection item is a heading. For example, section
heading, table header, etc.

<br />

| Returns ||
|---|---|
| `boolean` | If the item is a heading. <br /> |

### isSelected

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

```
public boolean isSelected ()
```

Gets if the collection item is selected.

<br />

| Returns ||
|---|---|
| `boolean` | If the item is selected. <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.CollectionItemInfo obtain (int rowIndex, 
                int rowSpan, 
                int columnIndex, 
                int columnSpan, 
                boolean heading)
```


**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.CollectionItemInfo#CollectionItemInfo(int,%20int,%20int,%20int,%20boolean)` instead.

Instantiates a new CollectionItemInfo.

<br />

| Parameters ||
|---|---|
| `rowIndex` | `int`: The row index at which the item is located. <br /> |
| `rowSpan` | `int`: The number of rows the item spans. <br /> |
| `columnIndex` | `int`: The column index at which the item is located. <br /> |
| `columnSpan` | `int`: The number of columns the item spans. <br /> |
| `heading` | `boolean`: Whether the item is a heading. (Prefer `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#setHeading(boolean)`). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.CollectionItemInfo` | <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.CollectionItemInfo obtain (int rowIndex, 
                int rowSpan, 
                int columnIndex, 
                int columnSpan, 
                boolean heading, 
                boolean selected)
```


**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.CollectionItemInfo#CollectionItemInfo(int,%20int,%20int,%20int,%20boolean)` instead.

Instantiates a new CollectionItemInfo.

<br />

| Parameters ||
|---|---|
| `rowIndex` | `int`: The row index at which the item is located. <br /> |
| `rowSpan` | `int`: The number of rows the item spans. <br /> |
| `columnIndex` | `int`: The column index at which the item is located. <br /> |
| `columnSpan` | `int`: The number of columns the item spans. <br /> |
| `heading` | `boolean`: Whether the item is a heading. (Prefer `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#setHeading(boolean)`). <br /> |
| `selected` | `boolean`: Whether the item is selected. <br /> |

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