MutableListModel

A ListModel model that lets callers modify it.

Inheritors

Inherited properties

Link copied to clipboard
abstract val changed: Pool<ModelObserver<T>>

Notifies of changes to the model

Link copied to clipboard
open val isEmpty: Boolean

Indicates whether the model has any contents

Link copied to clipboard
abstract val size: Int

Number of elements in the model

Functions

Link copied to clipboard
abstract fun add(value: T)

Adds a new value to the end of the model.

abstract fun add(index: Int, value: T)

Inserts a new value to the model at an index.

Link copied to clipboard
abstract fun addAll(values: Collection<T>)

Adds values to the end of the model.

abstract fun addAll(index: Int, values: Collection<T>)

Inserts values at index in the model.

Link copied to clipboard
abstract fun clear()

Removes all items from the model.

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

Forces the model to notify listeners that index changed. This is useful when the model has mutable items that change their internal state in some way that observers need to know about. Such changes cannot be detected by the model directly, since it relies on reference comparisons to detect changes.

Link copied to clipboard
abstract fun remove(value: T)

Removes value from the model.

Link copied to clipboard
abstract fun removeAll(values: Collection<T>)

Removes values from the model.

Link copied to clipboard
abstract fun removeAllAt(indexes: Collection<Int>)

Removes all values at the given indexes from the model.

Link copied to clipboard
abstract fun removeAt(index: Int): Result<T>

Removes the value at index from the model.

Link copied to clipboard
abstract fun replaceAll(values: Collection<T>)

Replaces all values in the model with new items.

Link copied to clipboard
abstract fun retainAll(values: Collection<T>)

Keeps only the items in the model that are contained within values.

Link copied to clipboard
abstract operator fun set(index: Int, value: T): Result<T>

Set the value at a specific index.

Link copied to clipboard
abstract fun <R : Comparable<R>> sortBy(selector: (T) -> R?)

Sorts the contents of the model ascending.

Link copied to clipboard
abstract fun <R : Comparable<R>> sortByDescending(selector: (T) -> R?)

Sorts the contents of the model descending.

Link copied to clipboard
abstract fun sortWith(comparator: Comparator<in T>)

Sorts the contents of the model ascending.

Link copied to clipboard
abstract fun sortWithDescending(comparator: Comparator<in T>)

Sorts the contents of the model descending.

Inherited functions

Link copied to clipboard
abstract fun contains(value: T): Boolean
Link copied to clipboard
abstract operator fun get(index: Int): Result<T>
Link copied to clipboard
abstract operator fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun section(range: ClosedRange<Int>): List<T>
Link copied to clipboard
Link copied to clipboard