All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin.collections.SetsJVM.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-Beta1
Show newest version
/*
 * Copyright 2010-2018 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("SetsKt")

package kotlin.collections


/**
 * Returns an immutable set containing only the specified object [element].
 * The returned set is serializable.
 */
public fun  setOf(element: T): Set = java.util.Collections.singleton(element)


/**
 * Returns a new [java.util.SortedSet] with the given elements.
 */
public fun  sortedSetOf(vararg elements: T): java.util.TreeSet = elements.toCollection(java.util.TreeSet())

/**
 * Returns a new [java.util.SortedSet] with the given [comparator] and elements.
 */
public fun  sortedSetOf(comparator: Comparator, vararg elements: T): java.util.TreeSet = elements.toCollection(java.util.TreeSet(comparator))





© 2015 - 2024 Weber Informatics LLC | Privacy Policy