Use fqnames for SortedSet and TreeSet from java.util

Remove internal typealiases for SortedSet and TreeSet
This commit is contained in:
Ilya Gorbunov
2017-12-18 06:14:16 +03:00
parent b456c52902
commit 8f78d73cd7
7 changed files with 36 additions and 40 deletions
+20 -20
View File
@@ -8022,64 +8022,64 @@ public fun CharArray.toSet(): Set<Char> {
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun <T: Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T> { public fun <T: Comparable<T>> Array<out T>.toSortedSet(): java.util.SortedSet<T> {
return toCollection(TreeSet<T>()) return toCollection(java.util.TreeSet<T>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun ByteArray.toSortedSet(): SortedSet<Byte> { public fun ByteArray.toSortedSet(): java.util.SortedSet<Byte> {
return toCollection(TreeSet<Byte>()) return toCollection(java.util.TreeSet<Byte>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun ShortArray.toSortedSet(): SortedSet<Short> { public fun ShortArray.toSortedSet(): java.util.SortedSet<Short> {
return toCollection(TreeSet<Short>()) return toCollection(java.util.TreeSet<Short>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun IntArray.toSortedSet(): SortedSet<Int> { public fun IntArray.toSortedSet(): java.util.SortedSet<Int> {
return toCollection(TreeSet<Int>()) return toCollection(java.util.TreeSet<Int>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun LongArray.toSortedSet(): SortedSet<Long> { public fun LongArray.toSortedSet(): java.util.SortedSet<Long> {
return toCollection(TreeSet<Long>()) return toCollection(java.util.TreeSet<Long>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun FloatArray.toSortedSet(): SortedSet<Float> { public fun FloatArray.toSortedSet(): java.util.SortedSet<Float> {
return toCollection(TreeSet<Float>()) return toCollection(java.util.TreeSet<Float>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun DoubleArray.toSortedSet(): SortedSet<Double> { public fun DoubleArray.toSortedSet(): java.util.SortedSet<Double> {
return toCollection(TreeSet<Double>()) return toCollection(java.util.TreeSet<Double>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun BooleanArray.toSortedSet(): SortedSet<Boolean> { public fun BooleanArray.toSortedSet(): java.util.SortedSet<Boolean> {
return toCollection(TreeSet<Boolean>()) return toCollection(java.util.TreeSet<Boolean>())
} }
/** /**
* Returns a [SortedSet] of all elements. * Returns a [SortedSet] of all elements.
*/ */
public fun CharArray.toSortedSet(): SortedSet<Char> { public fun CharArray.toSortedSet(): java.util.SortedSet<Char> {
return toCollection(TreeSet<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]. * 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> { public fun <T> Array<out T>.toSortedSet(comparator: Comparator<in T>): java.util.SortedSet<T> {
return toCollection(TreeSet<T>(comparator)) 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. * Returns a [SortedSet] of all elements.
*/ */
public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T> { public fun <T: Comparable<T>> Iterable<T>.toSortedSet(): java.util.SortedSet<T> {
return toCollection(TreeSet<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]. * Elements in the set returned are sorted according to the given [comparator].
*/ */
public fun <T> Iterable<T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T> { public fun <T> Iterable<T>.toSortedSet(comparator: Comparator<in T>): java.util.SortedSet<T> {
return toCollection(TreeSet<T>(comparator)) return toCollection(java.util.TreeSet<T>(comparator))
} }
/** /**
+4 -4
View File
@@ -700,8 +700,8 @@ public fun <T> Sequence<T>.toSet(): Set<T> {
* *
* The operation is _terminal_. * The operation is _terminal_.
*/ */
public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): SortedSet<T> { public fun <T: Comparable<T>> Sequence<T>.toSortedSet(): java.util.SortedSet<T> {
return toCollection(TreeSet<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_. * The operation is _terminal_.
*/ */
public fun <T> Sequence<T>.toSortedSet(comparator: Comparator<in T>): SortedSet<T> { public fun <T> Sequence<T>.toSortedSet(comparator: Comparator<in T>): java.util.SortedSet<T> {
return toCollection(TreeSet<T>(comparator)) return toCollection(java.util.TreeSet<T>(comparator))
} }
/** /**
+2 -2
View File
@@ -628,8 +628,8 @@ public fun CharSequence.toSet(): Set<Char> {
/** /**
* Returns a [SortedSet] of all characters. * Returns a [SortedSet] of all characters.
*/ */
public fun CharSequence.toSortedSet(): SortedSet<Char> { public fun CharSequence.toSortedSet(): java.util.SortedSet<Char> {
return toCollection(TreeSet<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. * Returns a new [SortedSet] with the given elements.
*/ */
@JvmVersion @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. * Returns a new [SortedSet] with the given [comparator] and elements.
*/ */
@JvmVersion @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) { 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 LinkedHashSet<E> = java.util.LinkedHashSet<E>
@SinceKotlin("1.1") public typealias HashSet<E> = java.util.HashSet<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 { } builder {
typeParam("T: Comparable<T>") typeParam("T: Comparable<T>")
doc { "Returns a [SortedSet] of all ${f.element.pluralize()}." } doc { "Returns a [SortedSet] of all ${f.element.pluralize()}." }
returns("SortedSet<T>") returns("java.util.SortedSet<T>")
body { "return toCollection(TreeSet<T>())" } body { "return toCollection(java.util.TreeSet<T>())" }
} }
val f_toSortedSet_comparator = fn("toSortedSet(comparator: Comparator<in 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]. Elements in the set returned are sorted according to the given [comparator].
""" """
} }
returns("SortedSet<T>") returns("java.util.SortedSet<T>")
body { "return toCollection(TreeSet<T>(comparator))" } body { "return toCollection(java.util.TreeSet<T>(comparator))" }
} }
val f_toMutableList = fn("toMutableList()") { val f_toMutableList = fn("toMutableList()") {