interface MutableList
source · line 24public
public interface MutableList<T> : List<T>, IndexSet<Long, T>
- Supertype
List<T> - Supertype
IndexSet<Long, T> - Inherited
operator fun get(index: Long): T· List<T> - Inherited
operator fun iterator(): Iterator<T>· Iterable<T> - Inherited
val size: Long· Collection<T>
An ordered collection supporting element replacement, insertion, removal, and clearing.
Extensions
public fun <T> MutableList<T>.sortWith(comparator: Comparator<T>): Unit· scoop:scoop.std:0.1.0public fun <T> MutableList<T>.shuffle(random: Random): Unit· scoop:scoop.std:0.1.0public fun <T : Equals<T>> MutableList<T>.removeAll(elements: Iterable<T>): Boolean· scoop:scoop.std:0.1.0public fun <T : Compare<T>> MutableList<T>.sort(): Unit· scoop:scoop.std:0.1.0public fun <T : Equals<T>> MutableList<T>.retainAll(elements: Iterable<T>): Boolean· scoop:scoop.std:0.1.0public fun <T> MutableList<T>.addAll(elements: Iterable<T>): Unit· scoop:scoop.std:0.1.0
function clear
source · line 45public
public fun clear(): Unit
Removes every element from the list.
function removeAt
source · line 41public
public fun removeAt(index: Long): T
Removes and returns the element at the supplied index, shifting later elements toward the beginning.
parameter index
source · line 41public
index: Long
function set
source · line 28public
public override operator fun set(index: Long, value: T): Unit
- Overrides
set· IndexSet
Replaces the element at an existing zero-based index without changing the size.
parameter value
source · line 28public
value: T
parameter index
source · line 28public
index: Long
function add
source · line 36public
public fun add(index: Long, value: T): Unit
Appends an element, or inserts it at the supplied position and shifts later elements.
parameter value
source · line 36public
value: T
parameter index
source · line 36public
index: Long
function add
source · line 32public
public fun add(value: T): Unit
Appends an element, or inserts it at the supplied position and shifts later elements.
parameter value
source · line 32public
value: T
type parameter T
source · line 24public
T