open class AutoPopulatingList<E : Any> : MutableList<E>, Serializable
Simple List wrapper class that allows for elements to be automatically populated as they are requested. This is particularly useful for data binding to List, allowing for elements to be created and added to the List in a "just in time" fashion.
Note: This class is not thread-safe. To create a thread-safe version, use the java.util.Collections#synchronizedList utility methods.
Inspired by LazyList from Commons Collections.
Author
Rob Harrop
Author
Juergen Hoeller
Since
2.0
AutoPopulatingList(elementClass: Class<out E>)
Creates a new AutoPopulatingList(backingList: MutableList<E>, elementClass: Class<out E>)
Creates a new AutoPopulatingList(elementFactory: ElementFactory)
Creates a new AutoPopulatingList(backingList: MutableList<E>, elementFactory: ElementFactory)
Creates a new |
open val size: Int |
open fun add(index: Int, element: E): Unitopen fun add(element: E): Boolean |
|
open fun addAll(elements: Collection<E>): Booleanopen fun addAll(index: Int, elements: Collection<E>): Boolean |
|
open fun clear(): Unit |
|
open fun contains(element: E): Boolean |
|
open fun containsAll(elements: Collection<E>): Boolean |
|
open fun equals(other: Any?): Boolean |
|
open fun get(index: Int): E
Get the element at the supplied index, creating it if there is no element at that index. |
|
open fun hashCode(): Int |
|
open fun indexOf(element: E): Int |
|
open fun isEmpty(): Boolean |
|
open fun iterator(): MutableIterator<E> |
|
open fun lastIndexOf(element: E): Int |
|
open fun listIterator(): MutableListIterator<E>open fun listIterator(index: Int): MutableListIterator<E> |
|
open fun remove(element: E): Boolean |
|
open fun removeAll(elements: Collection<E>): Boolean |
|
open fun removeAt(index: Int): E |
|
open fun retainAll(elements: Collection<E>): Boolean |
|
open fun set(index: Int, element: E): E |
|
open fun subList(fromIndex: Int, toIndex: Int): MutableList<E> |
|
open fun toArray(): Array<Any>open fun <T : Any> toArray(a: Array<T>): Array<T> |