public interface Collection<out E> : Iterable<E> {
public val size: Int
public fun isEmpty(): Boolean
public operator fun contains(
element: @UnsafeVariance E): Boolean
override fun iterator(): Iterator<E>
...
}
public interface List<out E> : Collection<E> {
override val size: Int
override fun isEmpty(): Boolean
override fun contains(element: @UnsafeVariance E): Boolean
override fun iterator(): Iterator<E>
public operator fun get(index: Int): E
public fun indexOf(element: @UnsafeVariance E): Int
public fun lastIndexOf(element: @UnsafeVariance E): Int
public fun listIterator(): ListIterator<E>
...
}
val studyingStudentSet: Set<Student> =
courses.flatMapTo(HashSet()) { it.students }
val otherStudent: List<Student> =
students - studyingStudentSet
public operator fun <T> Iterable<T>.minus(
elements: Iterable<T>
): List<T> {
val other = elements.convertToListIfNotCollection()
if (other.isEmpty())
return this.toList()
return this.filterNot { it in other }
}
public interface Map<K, out V> {
public val size: Int
public fun isEmpty(): Boolean
..
}
public interface Map<K, out V> {
..
public fun containsKey(key: K): Boolean
public fun containsValue(value: @UnsafeVariance V): Boolean
public operator fun get(key: K): V?
public fun getOrDefault(
key: K, defaultValue: @UnsafeVariance V): V
...
}
public interface Map<K, out V> {
...
public val keys: Set<K>
public val values: Collection<V>
public val entries: Set<Map.Entry<K, V>>
public interface Entry<out K, out V> {
public val key: K
public val value: V }}
public class String : Comparable<String>, CharSequence {
public operator fun plus(other: Any?): String
public override val length: Int
public override fun get(index: Int): Char
public override fun subSequence(
startIndex: Int, endIndex: Int): CharSequence
public override fun compareTo(other: String): Int
public override fun equals(other: Any?): Boolean
public override fun toString(): String
}
public expect fun CharSequence.elementAt(
index: Int): Char
public inline fun CharSequence.find(
predicate: (Char) -> Boolean): Char?
public inline fun CharSequence.indexOfFirst(
predicate: (Char) -> Boolean): Int
public fun String.drop(n: Int): String
public inline fun String.filter(
predicate: (Char) -> Boolean): String
public inline fun <R> CharSequence.flatMap(
transform: (Char) -> Iterable<R>): List<R>