typealias ArrayList<E> = ArrayList<E>
Platform and version requirements: Kotlin 1.1, JVM
open class ArrayList<E> : AbstractMutableList<E>, RandomAccess
Platform and version requirements: JS
Provides a MutableList implementation, which uses a resizable array as its backing storage.
This implementation doesn't provide a way to manage capacity, as backing JS array is resizeable itself. There is no speed advantage to pre-allocating array sizes in JavaScript, so this implementation does not include any of the capacity and "growth increment" concepts.
ArrayList(capacity: Int = 0) Creates an empty ArrayList. ArrayList(elements: Collection<E>) Creates an ArrayList filled from the elements collection. |
open val size: Int Returns the size of the collection. |
var modCount: Int |
open fun add(element: E): Boolean Adds the specified element to the collection. open fun add(index: Int, element: E) Inserts an element into the list at the specified index. | |
open fun addAll(elements: Collection<E>): Boolean Adds all of the elements in the specified collection to this collection. open fun addAll(index: Int, elements: Collection<E>): Boolean Inserts all of the elements in the specified collection elements into this list at the specified index. | |
open fun clear() Removes all elements from this collection. | |
fun ensureCapacity(minCapacity: Int) Does nothing in this ArrayList implementation. | |
open fun get(index: Int): E Returns the element at the specified index in the list. | |
open fun indexOf(element: E): Int Returns the index of the first occurrence of the specified element in the list, or -1 if the specified element is not contained in the list. | |
open fun lastIndexOf(element: E): Int Returns the index of the last occurrence of the specified element in the list, or -1 if the specified element is not contained in the list. | |
open fun remove(element: E): Boolean Removes a single instance of the specified element from this collection, if it is present. | |
open fun removeAt(index: Int): E Removes an element at the specified index from the list. | |
open fun removeRange(fromIndex: Int, toIndex: Int) Removes the range of elements from this list starting from fromIndex and ending with but not including toIndex. | |
open fun set(index: Int, element: E): E Replaces the element at the specified position in this list with the specified element. | |
open fun toArray(): Array<Any?> Returns new array of type | |
open fun toString(): String Returns a string representation of the object. | |
fun trimToSize() Does nothing in this ArrayList implementation. |
open fun contains(element: E): Boolean Checks if the specified element is contained in this collection. | |
open fun equals(other: Any?): Boolean Compares this list with another list instance with the ordered structural equality. | |
open fun hashCode(): Int Returns the hash code value for this list. | |
open fun iterator(): MutableIterator<E> Returns an iterator over the elements of this object. | |
open fun listIterator(index: Int): MutableListIterator<E> Returns a list iterator over the elements in this list (in proper sequence), starting at the specified index. open fun listIterator(): MutableListIterator<E> Returns a list iterator over the elements in this list (in proper sequence). | |
open fun removeAll(elements: Collection<E>): Boolean Removes all of this collection's elements that are also contained in the specified collection. | |
open fun retainAll(elements: Collection<E>): Boolean Retains only the elements in this collection that are contained in the specified collection. | |
open fun subList( fromIndex: Int, toIndex: Int ): MutableList<E> Returns a view of the portion of this list between the specified fromIndex (inclusive) and toIndex (exclusive). The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. |
© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-array-list/index.html