ItemSnapshotList
public final class ItemSnapshotList<T extends Object> extends AbstractList
| java.lang.Object | |||
| ↳ | kotlin.collections.AbstractCollection | ||
| ↳ | kotlin.collections.AbstractList | ||
| ↳ | androidx.paging.ItemSnapshotList |
Snapshot of data being presented by a androidx.pagingAsyncPagingDataDiffer or a androidx.paging.PagingDataAdapter.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
T |
get(int index)Returns the item at |
final @NonNull List<@NonNull T> |
getItems()The presented data, excluding placeholders. |
final int |
Number of placeholders after the presented |
final int |
Number of placeholders before the presented |
int |
getSize()Size of |
Inherited methods |
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public methods
get
public T get(int index)
Returns the item at index, where index includes the position of placeholders. If index points to the position of a placeholder, null is returned.
To get the size using an index excluding placeholders, use List.size on items directly.
| Throws | |
|---|---|
IndexOutOfBoundsException |
getItems
public final @NonNull List<@NonNull T> getItems()
The presented data, excluding placeholders.
getPlaceholdersAfter
public final int getPlaceholdersAfter()
Number of placeholders after the presented items, 0 if enablePlaceholders is false.
getPlaceholdersBefore
public final int getPlaceholdersBefore()
Number of placeholders before the presented items, 0 if enablePlaceholders is false.