AbstractDslMutableList

abstract class AbstractDslMutableList<I, O>(initial: MutableList<I> = mutableListOf()) : AbstractMutableList<O> , DslReplaceableList<O> (source)

An abstract class that provides a mutable list DSL implementation.

This class allows you to create a mutable list that transforms elements from type I to type O and vice versa. It provides methods to get, set, add, and remove elements while maintaining the transformation logic.

Parameters

I

The original type of the elements in the list.

O

The output type of the elements in the list after transformation.

Inheritors

Constructors

Link copied to clipboard
constructor(initial: MutableList<I> = mutableListOf())

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
open 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
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 abstract 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
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 abstract 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
abstract override fun subList(fromIndex: Int, toIndex: Int): MutableList<O>