{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ItemSnapshotList

class ItemSnapshotList<T : Any?> : AbstractList

kotlin.Any
   ↳ kotlin.collections.AbstractCollection
     ↳ kotlin.collections.AbstractList
       ↳ androidx.paging.ItemSnapshotList

Snapshot of data being presented by a androidx.pagingAsyncPagingDataDiffer or a PagingDataAdapter.

Summary

Public constructors

<T : Any?> ItemSnapshotList(
    placeholdersBefore: @IntRange(from = 0) Int,
    placeholdersAfter: @IntRange(from = 0) Int,
    items: List<T>
)

Public functions

open operator T?
get(index: Int)

Returns the item at index, where index includes the position of placeholders.

Public properties

List<T>

The presented data, excluding placeholders.

Int

Number of placeholders after the presented items, 0 if enablePlaceholders is false.

Int

Number of placeholders before the presented items, 0 if enablePlaceholders is false.

open Int

Size of ItemSnapshotList including placeholders.

Inherited functions

From kotlin.collections.AbstractCollection
open operator Boolean
contains(element: T?)
open Boolean
containsAll(elements: Collection<T?>)
open Boolean
open Array<Any?>
open Array<T>
<T : Any?> toArray(array: Array<T>)
open String
From kotlin.collections.AbstractList
open operator Boolean
equals(other: Any?)
open Int
open Int
indexOf(element: T?)
open operator Iterator<T?>
open Int
lastIndexOf(element: T?)
open ListIterator<T?>
open ListIterator<T?>
listIterator(index: Int)
open List<T?>
subList(fromIndex: Int, toIndex: Int)
From kotlin.collections.Collection
open Stream<T?>
open Spliterator<T?>
open Stream<T?>
open Array<T>
<T : Any> toArray(p0: IntFunction<Array<T>>)

This function is deprecated. This member is not fully supported by Kotlin compiler, so it may be absent or have different signature in next major version

From kotlin.collections.Iterable
open Unit
forEach(p0: Consumer<T?>)

Public constructors

ItemSnapshotList

<T : Any?> ItemSnapshotList(
    placeholdersBefore: @IntRange(from = 0) Int,
    placeholdersAfter: @IntRange(from = 0) Int,
    items: List<T>
)

Public functions

get

open operator fun get(index: Int): T?

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.

Public properties

items

val itemsList<T>

The presented data, excluding placeholders.

placeholdersAfter

val placeholdersAfterInt

Number of placeholders after the presented items, 0 if enablePlaceholders is false.

placeholdersBefore

val placeholdersBeforeInt

Number of placeholders before the presented items, 0 if enablePlaceholders is false.

size

open val sizeInt

Size of ItemSnapshotList including placeholders.

To get the size excluding placeholders, use List.size on items directly.

See also
items