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 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 SortedSet of all elements.

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

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