replaceAll

open fun replaceAll(@NonNull items: Array<T>, mayModifyInput: Boolean)(source)

Replaces the current items with the new items, dispatching ListUpdateCallback events for each change detected as appropriate.

If allowed, will reference the input array during, and possibly after, the operation to avoid extra memory allocation, in which case you should not continue to reference or modify the array yourself.

Note: this method does not detect moves or dispatch onMoved events. It instead treats moves as a remove followed by an add and therefore dispatches onRemoved and onRemoved events. See DiffUtil if you want your implementation to dispatch move events.

Parameters

items

Array of items to replace current items.

mayModifyInput

If true, SortedList is allowed to modify and permanently reference the input array.

See also


open fun replaceAll(@NonNull items: Array<T>)(source)
open fun replaceAll(@NonNull items: Collection<T>)(source)

Replaces the current items with the new items, dispatching ListUpdateCallback events for each change detected as appropriate. Does not modify or retain the input.

Parameters

items

Array of items to replace current items.

See also