Provide mutableListOf.

Deprecate linkedListOf.
#KT-9663
This commit is contained in:
Ilya Gorbunov
2016-01-16 05:14:28 +03:00
parent 60ca1cbcf3
commit fe8ba4d356
4 changed files with 35 additions and 26 deletions
@@ -74,9 +74,18 @@ public fun <T> listOf(element: T): List<T> = Collections.singletonList(element)
/** Returns a new [LinkedList] with the given elements. */
@JvmVersion
@Deprecated("Use LinkedList constructor.", ReplaceWith("LinkedList(listOf(*elements))", "java.util.LinkedList"))
public fun <T> linkedListOf(vararg elements: T): LinkedList<T>
= if (elements.size == 0) LinkedList() else LinkedList(ArrayAsCollection(elements))
@Deprecated("Use LinkedList constructor.", ReplaceWith("LinkedList<T>()", "java.util.LinkedList"))
public fun <T> linkedListOf() = LinkedList<T>()
/** Returns a new [MutableList] with the given elements. */
public fun <T> mutableListOf(vararg elements: T): MutableList<T>
= if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements))
/** Returns a new [ArrayList] with the given elements. */
public fun <T> arrayListOf(vararg elements: T): ArrayList<T>
= if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements))