
name.remal.collections.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-kotlin Show documentation
Show all versions of common-kotlin Show documentation
Java & Kotlin tools: common-kotlin
The newest version!
package name.remal
import java.util.*
import java.util.Collections.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
fun queueOf(): Queue = LinkedList()
fun queueOf(vararg elements: T): Queue = LinkedList().apply { addAll(elements) }
fun dequeOf(): Deque = LinkedList()
fun dequeOf(vararg elements: T): Deque = LinkedList().apply { addAll(elements) }
fun concurrentSetOf(): MutableSet = newSetFromMap(ConcurrentHashMap())
fun concurrentSetOf(vararg elements: T): MutableSet = newSetFromMap(ConcurrentHashMap()).apply { addAll(elements) }
fun synchronizedSetOf(): MutableSet = synchronizedSet(mutableSetOf())
fun synchronizedSetOf(vararg elements: T): MutableSet = synchronizedSet(mutableSetOf(*elements))
fun synchronizedSortedSetOf(): SortedSet = synchronizedSortedSet(sortedSetOf())
fun synchronizedSortedSetOf(vararg elements: T): SortedSet = synchronizedSortedSet(sortedSetOf(*elements))
fun synchronizedNavigableSetOf(): NavigableSet = synchronizedNavigableSet(sortedSetOf())
fun synchronizedNavigableSetOf(vararg elements: T): NavigableSet = synchronizedNavigableSet(sortedSetOf(*elements))
fun synchronizedListOf(): MutableList = synchronizedList(mutableListOf())
fun synchronizedListOf(vararg elements: T): MutableList = synchronizedList(mutableListOf(*elements))
fun copyOnWriteListOf(): MutableList = CopyOnWriteArrayList()
fun copyOnWriteListOf(vararg elements: T): MutableList = CopyOnWriteArrayList().apply { addAll(elements) }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy