AtomicList

open class AtomicList<T>(delegate: List<T> = emptyList()) : List<T> , <ERROR CLASS> ERROR CLASS: Symbol not found for SynchronizedObject(source)

A thread-safe list backed by SynchronizedObject.

For iteration, wrap block in withLock to hold the lock for the duration: list.withLock { list.forEach { ... } }

Inheritors

Constructors

Link copied to clipboard
constructor(delegate: List<T> = emptyList())

Properties

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
suspend fun <A, B> List<A>.amap(f: suspend (A) -> B): List<B>

Short for "Asynchronous Map", runs on all values concurrently, this means that if you are not doing networking, you should use a regular map

Link copied to clipboard
suspend fun <A, B> List<A>.amapIndexed(f: suspend (index: Int, A) -> B): List<B>

Short for "Asynchronous Map" with an Index, runs on all values concurrently, this means that if you are not doing networking, you should use a regular mapIndexed

Link copied to clipboard
fun <A, B> List<A>.apmap(f: suspend (A) -> B): List<B>

Short for "Asynchronous Parallel Map", but is not really parallel, only concurrent.

Link copied to clipboard
fun <A, B> List<A>.apmapIndexed(f: suspend (index: Int, A) -> B): List<B>

Short for "Asynchronous Parallel Map" with an Index, but is not really parallel, only concurrent.

Link copied to clipboard
open operator override fun contains(element: T): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean
Link copied to clipboard
fun distinctBy(selector: (T) -> Any?): AtomicList<T>
Link copied to clipboard
fun filter(predicate: (T) -> Boolean): AtomicList<T>
Link copied to clipboard
open operator override fun get(index: Int): T
Link copied to clipboard
open override fun indexOf(element: T): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<T>
Link copied to clipboard
open override fun lastIndexOf(element: T): Int
Link copied to clipboard
open override fun listIterator(): ListIterator<T>
open override fun listIterator(index: Int): ListIterator<T>
Link copied to clipboard
operator fun plus(element: T): AtomicList<T>
operator fun plus(elements: Collection<T>): AtomicList<T>
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<T>
Link copied to clipboard
Link copied to clipboard
fun <R> withLock(block: () -> R): R