ListProperty

class ListProperty<I, O>(initial: MutableList<I> = mutableListOf(), getTransform: DslMutableList<O>.(I) -> O, setTransform: DslMutableList<O>.(O) -> I, beforeGet: DslMutableList<O>.(Int) -> Unit = {}, beforeSet: DslMutableList<O>.(Int, O) -> Unit = { _, _ -> }, beforeRemove: DslMutableList<O>.(Int) -> Unit = {}, beforeAccess: DslMutableList<O>.() -> Unit = {}, beforeReplace: DslMutableList<O>.(MutableList<O>) -> Unit = {}, accessTransform: DslMutableList<O>.() -> MutableList<O> = { this }, getDslMutableList: (DslMutableList<O>) -> Unit = {}) : AbstractDslMutableList<I, O> , DslReadWriteListProperty<O> (source)

Constructors

Link copied to clipboard
constructor(initial: MutableList<I> = mutableListOf(), getTransform: DslMutableList<O>.(I) -> O, setTransform: DslMutableList<O>.(O) -> I, beforeGet: DslMutableList<O>.(Int) -> Unit = {}, beforeSet: DslMutableList<O>.(Int, O) -> Unit = { _, _ -> }, beforeRemove: DslMutableList<O>.(Int) -> Unit = {}, beforeAccess: DslMutableList<O>.() -> Unit = {}, beforeReplace: DslMutableList<O>.(MutableList<O>) -> Unit = {}, accessTransform: DslMutableList<O>.() -> MutableList<O> = { this }, getDslMutableList: (DslMutableList<O>) -> Unit = {})

Properties

Link copied to clipboard
protected open var delegate: MutableList<I>

The delegate list that stores the original type I values. This is mutable and can be replaced with a new list.

Link copied to clipboard
protected expect var modCount: Int
Link copied to clipboard
abstract override val size: Int

Functions

Link copied to clipboard
abstract override fun add(element: O): Boolean
open override fun add(index: Int, element: O)
Link copied to clipboard
abstract override fun addAll(elements: Collection<O>): Boolean
abstract fun addAll(index: Int, elements: Collection<O>): Boolean
Link copied to clipboard
open override fun <R> bypassHooks(block: DslMutableList.BypassedHooks<O>.() -> R): R
Link copied to clipboard
abstract override fun clear()
Link copied to clipboard
abstract operator override fun contains(element: O): Boolean
Link copied to clipboard
abstract override fun containsAll(elements: Collection<O>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): O
Link copied to clipboard
protected open override fun getTransform(original: I): O

Transforms the original type I to the output type O. This method should be implemented to define how the transformation from I to O is done.

Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): MutableList<O>

Gets the value of the property as a mutable list of type T. The operations on this list is under the control of the DSL. DO NOT use this list when extracting the final list, as it will not be transformed.

Link copied to clipboard
abstract fun indexOf(element: O): Int
Link copied to clipboard
abstract override fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): Iterator<O>
Link copied to clipboard
abstract fun lastIndexOf(element: O): Int
Link copied to clipboard
abstract override fun listIterator(): MutableListIterator<O>
abstract override fun listIterator(index: Int): MutableListIterator<O>
Link copied to clipboard
protected fun originalAdd(index: Int, element: O)
Link copied to clipboard
protected fun originalGet(index: Int): O
Link copied to clipboard
protected fun originalRemoveAt(index: Int): O
Link copied to clipboard
protected fun originalSet(index: Int, element: O): O
Link copied to clipboard
abstract override fun remove(element: O): Boolean
Link copied to clipboard
abstract override fun removeAll(elements: Collection<O>): Boolean
Link copied to clipboard
open override fun removeAt(index: Int): O
Link copied to clipboard
protected expect open fun removeRange(fromIndex: Int, toIndex: Int)
Link copied to clipboard
open override fun replace(list: MutableList<O>)

Replaces the current list with a new one.

Link copied to clipboard
abstract override fun retainAll(elements: Collection<O>): Boolean
Link copied to clipboard
open operator override fun set(index: Int, element: O): O
Link copied to clipboard
protected open override fun setTransform(original: O): I

Transforms the output type O back to the original type I. This method should be implemented to define how the transformation from O to I is done.

Link copied to clipboard
open operator override fun setValue(thisRef: Any?, property: KProperty<*>, value: MutableList<O>)

Replaces the current list with a new one.

Link copied to clipboard
abstract override fun subList(fromIndex: Int, toIndex: Int): MutableList<O>