Use fqnames for SortedSet and TreeSet from java.util
Remove internal typealiases for SortedSet and TreeSet
This commit is contained in:
@@ -8022,64 +8022,64 @@ public fun CharArray.toSet(): Set<Char> {
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun <T: Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T> {
|
||||
return toCollection(TreeSet<T>())
|
||||
public fun <T: Comparable<T>> Array<out T>.toSortedSet(): java.util.SortedSet<T> {
|
||||
return toCollection(java.util.TreeSet<T>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun ByteArray.toSortedSet(): SortedSet<Byte> {
|
||||
return toCollection(TreeSet<Byte>())
|
||||
public fun ByteArray.toSortedSet(): java.util.SortedSet<Byte> {
|
||||
return toCollection(java.util.TreeSet<Byte>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun ShortArray.toSortedSet(): SortedSet<Short> {
|
||||
return toCollection(TreeSet<Short>())
|
||||
public fun ShortArray.toSortedSet(): java.util.SortedSet<Short> {
|
||||
return toCollection(java.util.TreeSet<Short>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun IntArray.toSortedSet(): SortedSet<Int> {
|
||||
return toCollection(TreeSet<Int>())
|
||||
public fun IntArray.toSortedSet(): java.util.SortedSet<Int> {
|
||||
return toCollection(java.util.TreeSet<Int>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun LongArray.toSortedSet(): SortedSet<Long> {
|
||||
return toCollection(TreeSet<Long>())
|
||||
public fun LongArray.toSortedSet(): java.util.SortedSet<Long> {
|
||||
return toCollection(java.util.TreeSet<Long>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun FloatArray.toSortedSet(): SortedSet<Float> {
|
||||
return toCollection(TreeSet<Float>())
|
||||
public fun FloatArray.toSortedSet(): java.util.SortedSet<Float> {
|
||||
return toCollection(java.util.TreeSet<Float>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun DoubleArray.toSortedSet(): SortedSet<Double> {
|
||||
return toCollection(TreeSet<Double>())
|
||||
public fun DoubleArray.toSortedSet(): java.util.SortedSet<Double> {
|
||||
return toCollection(java.util.TreeSet<Double>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun BooleanArray.toSortedSet(): SortedSet<Boolean> {
|
||||
return toCollection(TreeSet<Boolean>())
|
||||
public fun BooleanArray.toSortedSet(): java.util.SortedSet<Boolean> {
|
||||
return toCollection(java.util.TreeSet<Boolean>())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun CharArray.toSortedSet(): SortedSet<Char> {
|
||||
return toCollection(TreeSet<Char>())
|
||||
public fun CharArray.toSortedSet(): java.util.SortedSet<Char> {
|
||||
return toCollection(java.util.TreeSet<Char>())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -8087,8 +8087,8 @@ public fun CharArray.toSortedSet(): SortedSet<Char> {
|
||||
*
|
||||
* Elements in the set returned are sorted according to the given [comparator].
|
||||
*/
|
||||
public fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T> {
|
||||
return toCollection(TreeSet<T>(comparator))
|
||||
public fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): java.util.SortedSet<T> {
|
||||
return toCollection(java.util.TreeSet<T>(comparator))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1117,8 +1117,8 @@ public fun <T> Iterable<T>.toSet(): Set<T> {
|
||||
/**
|
||||
* Returns a [SortedSet] of all elements.
|
||||
*/
|
||||
public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T> {
|
||||
return toCollection(TreeSet<T>())
|
||||
public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): java.util.SortedSet<T> {
|
||||
return toCollection(java.util.TreeSet<T>())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1126,8 +1126,8 @@ public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T> {
|
||||
*
|
||||
* Elements in the set returned are sorted according to the given [comparator].
|
||||
*/
|
||||
public fun <T> Iterable<T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T> {
|
||||
return toCollection(TreeSet<T>(comparator))
|
||||
public fun <T> Iterable<T>.toSortedSet(comparator: Comparator<in T>): java.util.SortedSet<T> {
|
||||
return toCollection(java.util.TreeSet<T>(comparator))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -700,8 +700,8 @@ public fun <T> Sequence<T>.toSet(): Set<T> {
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): SortedSet<T> {
|
||||
return toCollection(TreeSet<T>())
|
||||
public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): java.util.SortedSet<T> {
|
||||
return toCollection(java.util.TreeSet<T>())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -711,8 +711,8 @@ public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): SortedSet<T> {
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
public fun <T> Sequence<T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T> {
|
||||
return toCollection(TreeSet<T>(comparator))
|
||||
public fun <T> Sequence<T>.toSortedSet(comparator: Comparator<in T>): java.util.SortedSet<T> {
|
||||
return toCollection(java.util.TreeSet<T>(comparator))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -628,8 +628,8 @@ public fun CharSequence.toSet(): Set<Char> {
|
||||
/**
|
||||
* Returns a [SortedSet] of all characters.
|
||||
*/
|
||||
public fun CharSequence.toSortedSet(): SortedSet<Char> {
|
||||
return toCollection(TreeSet<Char>())
|
||||
public fun CharSequence.toSortedSet(): java.util.SortedSet<Char> {
|
||||
return toCollection(java.util.TreeSet<Char>())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,13 +91,13 @@ public fun <T> setOf(element: T): Set<T> = java.util.Collections.singleton(eleme
|
||||
* Returns a new [SortedSet] with the given elements.
|
||||
*/
|
||||
@JvmVersion
|
||||
public fun <T> sortedSetOf(vararg elements: T): TreeSet<T> = elements.toCollection(TreeSet<T>())
|
||||
public fun <T> sortedSetOf(vararg elements: T): java.util.TreeSet<T> = elements.toCollection(java.util.TreeSet<T>())
|
||||
|
||||
/**
|
||||
* Returns a new [SortedSet] with the given [comparator] and elements.
|
||||
*/
|
||||
@JvmVersion
|
||||
public fun <T> sortedSetOf(comparator: Comparator<in T>, vararg elements: T): TreeSet<T> = elements.toCollection(TreeSet<T>(comparator))
|
||||
public fun <T> sortedSetOf(comparator: Comparator<in T>, vararg elements: T): java.util.TreeSet<T> = elements.toCollection(java.util.TreeSet<T>(comparator))
|
||||
|
||||
|
||||
internal fun <T> Set<T>.optimizeReadOnlySet() = when (size) {
|
||||
|
||||
@@ -11,7 +11,3 @@ package kotlin.collections
|
||||
@SinceKotlin("1.1") public typealias LinkedHashSet<E> = java.util.LinkedHashSet<E>
|
||||
@SinceKotlin("1.1") public typealias HashSet<E> = java.util.HashSet<E>
|
||||
|
||||
|
||||
// also @SinceKotlin("1.1")
|
||||
internal typealias SortedSet<E> = java.util.SortedSet<E>
|
||||
internal typealias TreeSet<E> = java.util.TreeSet<E>
|
||||
@@ -101,8 +101,8 @@ object Snapshots : TemplateGroupBase() {
|
||||
} builder {
|
||||
typeParam("T: Comparable<T>")
|
||||
doc { "Returns a [SortedSet] of all ${f.element.pluralize()}." }
|
||||
returns("SortedSet<T>")
|
||||
body { "return toCollection(TreeSet<T>())" }
|
||||
returns("java.util.SortedSet<T>")
|
||||
body { "return toCollection(java.util.TreeSet<T>())" }
|
||||
}
|
||||
|
||||
val f_toSortedSet_comparator = fn("toSortedSet(comparator: Comparator<in T>)") {
|
||||
@@ -116,8 +116,8 @@ object Snapshots : TemplateGroupBase() {
|
||||
Elements in the set returned are sorted according to the given [comparator].
|
||||
"""
|
||||
}
|
||||
returns("SortedSet<T>")
|
||||
body { "return toCollection(TreeSet<T>(comparator))" }
|
||||
returns("java.util.SortedSet<T>")
|
||||
body { "return toCollection(java.util.TreeSet<T>(comparator))" }
|
||||
}
|
||||
|
||||
val f_toMutableList = fn("toMutableList()") {
|
||||
|
||||
Reference in New Issue
Block a user