W3cubDocs

/Kotlin

toSortedSet

Platform and version requirements: JVM (1.0)
fun <T : Comparable<T>> Array<out T>.toSortedSet(): SortedSet<T>
fun ByteArray.toSortedSet(): SortedSet<Byte>
fun ShortArray.toSortedSet(): SortedSet<Short>
fun IntArray.toSortedSet(): SortedSet<Int>
fun LongArray.toSortedSet(): SortedSet<Long>
fun FloatArray.toSortedSet(): SortedSet<Float>
fun DoubleArray.toSortedSet(): SortedSet<Double>
fun BooleanArray.toSortedSet(): SortedSet<Boolean>
fun CharArray.toSortedSet(): SortedSet<Char>
fun <T : Comparable<T>> Iterable<T>.toSortedSet(): SortedSet<T>

Returns a new SortedSet of all elements.

Platform and version requirements: JVM (1.0)
fun <T> Array<out T>.toSortedSet(
    comparator: Comparator<in T>
): SortedSet<T>
fun <T> Iterable<T>.toSortedSet(
    comparator: Comparator<in T>
): SortedSet<T>

Returns a new SortedSet of all elements.

Elements in the set returned are sorted according to the given comparator.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/to-sorted-set.html