generated._CollectionsJvm.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lightstep-opentelemetry-auto-exporter Show documentation
Show all versions of lightstep-opentelemetry-auto-exporter Show documentation
Lightstep OpenTelemetry Auto Exporter
The newest version!
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("CollectionsKt")
package kotlin.collections
//
// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
import kotlin.ranges.contains
import kotlin.ranges.reversed
/**
* Returns a list containing all elements that are instances of specified class.
*/
public fun Iterable<*>.filterIsInstance(klass: Class): List {
return filterIsInstanceTo(ArrayList(), klass)
}
/**
* Appends all elements that are instances of specified class to the given [destination].
*/
public fun , R> Iterable<*>.filterIsInstanceTo(destination: C, klass: Class): C {
@Suppress("UNCHECKED_CAST")
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
return destination
}
/**
* Reverses elements in the list in-place.
*/
public actual fun MutableList.reverse(): Unit {
java.util.Collections.reverse(this)
}
/**
* Returns a [SortedSet][java.util.SortedSet] of all elements.
*/
public fun > Iterable.toSortedSet(): java.util.SortedSet {
return toCollection(java.util.TreeSet())
}
/**
* Returns a [SortedSet][java.util.SortedSet] of all elements.
*
* Elements in the set returned are sorted according to the given [comparator].
*/
public fun Iterable.toSortedSet(comparator: Comparator): java.util.SortedSet {
return toCollection(java.util.TreeSet(comparator))
}