WatchableList

A Watchable which may also be modified or bound. Use watchableListOf to create.

interface WatchableList<T> : MutableWatchable<MutableList<T>, ListChange<T>> , ReadOnlyWatchableList<T>

Functions

add
Link copied to clipboard

Add element to the end of this list, returning true if the list changed.

open suspend fun add(element: T): Boolean
addAll
Link copied to clipboard

Add elements to the end of this list, returning true if the list changed.

open suspend fun addAll(elements: Array<T>): Boolean
open suspend fun addAll(elements: Iterable<T>): Boolean
open suspend fun addAll(elements: Sequence<T>): Boolean
batch
Link copied to clipboard
abstract override fun batch(scope: CoroutineScope, period: Long, func: SuspendFunction1<List<ListChange<T>>, Unit>): Watcher
bind
Link copied to clipboard

Binds this unbound object to origin, such that when origin changes, this object is updated to match origin exactly, until scope completes. While bound, this object may not be externally modified or rebound.

abstract override fun bind(scope: CoroutineScope, origin: Watchable<ListChange<T>>): Watcher

Binds this unbound object to origin, such that for every change to origin, the change is applied to this object with apply, until scope completes. While bound, this object may not be externally modified or rebound.

abstract override fun <C2 : Change> bind(scope: CoroutineScope, origin: Watchable<C2>, period: Long, apply: MutableList<T>.(C2) -> Unit): Watcher
clear
Link copied to clipboard

Remove all items.

abstract suspend override fun clear()
contains
Link copied to clipboard
abstract operator override fun contains(element: T): Boolean
containsAll
Link copied to clipboard
abstract override fun containsAll(elements: Collection<T>): Boolean
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
forEach
Link copied to clipboard
open override fun forEach(p0: Consumer<in T>)
get
Link copied to clipboard
abstract operator override fun get(index: Int): T
hashCode
Link copied to clipboard
open override fun hashCode(): Int
indexOf
Link copied to clipboard
abstract override fun indexOf(element: T): Int
invoke
Link copied to clipboard

Suspend until func can safely execute on the mutable form M of this watchable, returning func's result. func must not block or return the mutable form outside of this routine.

abstract suspend operator override fun <U> invoke(func: MutableList<T>.() -> U): U
isBound
Link copied to clipboard

Return true if this object is already bound.

open override fun isBound(): Boolean
isEmpty
Link copied to clipboard
abstract override fun isEmpty(): Boolean
iterator
Link copied to clipboard
abstract operator override fun iterator(): Iterator<T>
lastIndexOf
Link copied to clipboard
abstract override fun lastIndexOf(element: T): Int
listIterator
Link copied to clipboard
abstract override fun listIterator(): ListIterator<T>
abstract override fun listIterator(index: Int): ListIterator<T>
minusAssign
Link copied to clipboard

Remove element from this list.

open suspend operator fun minusAssign(element: T)

Remove elements from this list.

open suspend operator fun minusAssign(elements: Array<T>)
open suspend operator fun minusAssign(elements: Iterable<T>)
open suspend operator fun minusAssign(elements: Sequence<T>)
parallelStream
Link copied to clipboard
open override fun parallelStream(): Stream<T>
plusAssign
Link copied to clipboard

Add element to the end of this list.

open suspend operator fun plusAssign(element: T)

Add elements to the end of this list.

open suspend operator fun plusAssign(elements: Array<T>)
open suspend operator fun plusAssign(elements: Iterable<T>)
open suspend operator fun plusAssign(elements: Sequence<T>)
readOnly
Link copied to clipboard

Return an unmodifiable form of this WatchableList.

abstract override fun readOnly(): ReadOnlyWatchableList<T>
remove
Link copied to clipboard

Remove element from this list, returning true if the list changed.

open suspend fun remove(element: T): Boolean
removeAll
Link copied to clipboard

Remove elements from this list, returning true if the list changed.

open suspend fun removeAll(elements: Array<T>): Boolean
open suspend fun removeAll(elements: Iterable<T>): Boolean
open suspend fun removeAll(elements: Sequence<T>): Boolean
retainAll
Link copied to clipboard

Retain only the elements in this list that are found in elements, returning true if the list changed.

open suspend fun retainAll(elements: Iterable<T>): Boolean
simple
Link copied to clipboard

Deliver simplified changes to func until scope completes.

open override fun simple(scope: CoroutineScope, period: Long, func: SuspendFunction1<ListChange.Simple<T>, Unit>): Watcher
spliterator
Link copied to clipboard
open override fun spliterator(): Spliterator<T>
stream
Link copied to clipboard
open override fun stream(): Stream<T>
subList
Link copied to clipboard
abstract override fun subList(fromIndex: Int, toIndex: Int): List<T>
toString
Link copied to clipboard
open override fun toString(): String
twoWayBind
Link copied to clipboard

Bind other to this so that any change in either object is reflected in the other.

abstract override fun twoWayBind(scope: CoroutineScope, other: MutableWatchable<MutableList<T>, ListChange<T>>): Watcher
abstract override fun <M2, C2 : Change> twoWayBind(scope: CoroutineScope, other: MutableWatchable<M2, C2>, update: MutableList<T>.(C2) -> Unit, updateOther: M2.(ListChange<T>) -> Unit): Watcher
unbind
Link copied to clipboard

Remove any existing binding for this object.

abstract override fun unbind()
waitFor
Link copied to clipboard
open suspend override fun waitFor(scope: CoroutineScope, func: () -> Boolean)
watch
Link copied to clipboard
open override fun watch(scope: CoroutineScope, period: Long, func: SuspendFunction1<ListChange<T>, Unit>): Watcher

Properties

boundTo
Link copied to clipboard

The Watchable to which this object is bound, if any.

abstract override val boundTo: Watchable<*>?
size
Link copied to clipboard
abstract override val size: Int