ObservableList

interface ObservableList<E> : MutableList<E>

A List that notifies observers of changes to its contents.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Notifies of changes to the list

Inherited properties

Link copied to clipboard
abstract override val size: Int

Functions

Link copied to clipboard
abstract fun <T> batch(block: MutableList<E>.() -> T): T

Runs the operations within block and then applies them all to the list as a single operation. This reduces the set of events that would normally trigger if these operations were done sequentially.

Link copied to clipboard
abstract operator fun minusAssign(element: E)

Removes element from the list

Link copied to clipboard
abstract fun move(element: E, to: Int): Boolean

Moves element to a new index.

Link copied to clipboard
abstract fun notifyChanged(index: Int)

Explicitly trigger a diff that shows the element at index being deleted and re-added. This is useful for cases where the elements in the list are mutable and a change has happened to one that would normally not result in a call to changed (which only notifies of membership changes.

Link copied to clipboard
abstract operator fun plusAssign(element: E)

Adds element to the list

Link copied to clipboard
abstract fun replaceAll(elements: Collection<E>): Boolean

Replaces the list's contents with elements.

Inherited functions

Link copied to clipboard
abstract override fun add(element: E): Boolean
abstract fun add(index: Int, element: E)
Link copied to clipboard
abstract override fun addAll(elements: Collection<E>): Boolean
abstract fun addAll(index: Int, elements: Collection<E>): Boolean
Link copied to clipboard
fun <T> MutableList<T>.addOrAppend(at: Int, value: T)

Ads value to the list at the specify index, or at the end of the list if that index exceeds the current list length.

Link copied to clipboard
fun Collection<Completable>.allCompleted(completed: () -> Unit)
Link copied to clipboard
abstract override fun clear()
Link copied to clipboard
abstract operator override fun contains(element: E): Boolean
Link copied to clipboard
operator fun <E> Collection<E>?.contains(element: E): Boolean

Nullable helper

Link copied to clipboard
abstract override fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract operator fun get(index: Int): E
Link copied to clipboard
abstract fun indexOf(element: E): Int
Link copied to clipboard
abstract override fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): Iterator<E>
Link copied to clipboard
abstract fun lastIndexOf(element: E): Int
Link copied to clipboard
abstract override fun listIterator(): MutableListIterator<E>
abstract override fun listIterator(index: Int): MutableListIterator<E>
Link copied to clipboard
abstract override fun remove(element: E): Boolean
Link copied to clipboard
abstract override fun removeAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract fun removeAt(index: Int): E
Link copied to clipboard
abstract override fun retainAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract operator fun set(index: Int, element: E): E
Link copied to clipboard
fun <T> ObservableList<T>.sortWith(comparator: Comparator<in T>)
Link copied to clipboard
Link copied to clipboard
abstract override fun subList(fromIndex: Int, toIndex: Int): MutableList<E>