interface Iterable
source · line 14public
public interface Iterable<T>
A value that supplies an Iterator for the for-loop protocol.
Extensions
public fun <T> Iterable<T>.toSortedSet(comparator: Comparator<T>): SortedSet<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.single(predicate: (T) -> Boolean): T· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.last(predicate: (T) -> Boolean): T· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.firstOrNone(predicate: (T) -> Boolean): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.partition(predicate: (T) -> Boolean): (List<T>, List<T>)· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.count(predicate: (T) -> Boolean): Long· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.shuffled(random: Random): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.randomOrNone(random: Random): T?· scoop:scoop.std:0.1.0public fun <T, K, V> Iterable<T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.withIndex(): Iterable<IndexedValue<T>>· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.flatMapTo(destination: MutableList<R>, transform: (T) -> Iterable<R>): MutableList<R>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.any(): Boolean· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.mapNotNone(transform: (T) -> R?): List<R>· scoop:scoop.std:0.1.0public fun <T> Iterable<T?>.filterNotNone(): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.toSet(): Set<T> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Long = -1L, truncated: String = "...", transform: (T) -> String): String· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.singleOrNone(predicate: (T) -> Boolean): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<Iterable<T>>.flatten(): List<T>· scoop:scoop.std:0.1.0public fun <T, K, V> Iterable<T>.groupByTo(destination: MutableMap<K, MutableList<V>>, keySelector: (T) -> K, valueTransform: (T) -> V): MutableMap<K, MutableList<V>>· scoop:scoop.std:0.1.0public fun <K, V> Iterable<(K, V)>.toSortedMap(comparator: Comparator<K>): SortedMap<K, V>· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.flatMap(transform: (T) -> Iterable<R>): List<R>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.dropWhile(predicate: (T) -> Boolean): List<T>· scoop:scoop.std:0.1.0public fun <K : Compare<K>, V> Iterable<(K, V)>.toSortedMap(): SortedMap<K, V>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.windowed(size: Long, step: Long = 1L, partialWindows: Boolean = false): List<List<T>>· scoop:scoop.std:0.1.0public infix fun <T> Iterable<T>.subtract(other: Iterable<T>): Set<T> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.toCollection(destination: MutableSet<T>): MutableSet<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.take(count: Long): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.asSequence(): Sequence<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.minWithOrNone(comparator: Comparator<T>): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.find(predicate: (T) -> Boolean): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.toMutableSet(): MutableSet<T> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.sortedWith(comparator: Comparator<T>): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.toMutableList(): MutableList<T>· scoop:scoop.std:0.1.0public fun <T, K, V> Iterable<T>.associate(transform: (T) -> (K, V)): Map<K, V> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.random(random: Random): T· scoop:scoop.std:0.1.0public fun <T, K> Iterable<T>.distinctBy(selector: (T) -> K): List<T> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R>· scoop:scoop.std:0.1.0public fun <T, K, V> Iterable<T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.zip(other: Iterable<R>): List<(T, R)>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.first(): T· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.first(predicate: (T) -> Boolean): T· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.chunked(size: Long): List<List<T>>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.onEach(action: (T) -> Unit): Iterable<T>· scoop:scoop.std:0.1.0public fun <T : Compare<T>> Iterable<T>.minOrNone(): T?· scoop:scoop.std:0.1.0public fun <T, V> Iterable<T>.associateWith(valueSelector: (T) -> V): Map<T, V> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.takeWhile(predicate: (T) -> Boolean): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.last(): T· scoop:scoop.std:0.1.0public fun <T : ToString> Iterable<T>.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Long = -1L, truncated: String = "..."): String· scoop:scoop.std:0.1.0public fun <T : Equals<T>> Iterable<T>.indexOf(element: T): Long· scoop:scoop.std:0.1.0public fun <T : Compare<T>> Iterable<T>.toSortedSet(): SortedSet<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.reduceOrNone(operation: (T, T) -> T): T?· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.fold(initial: R, operation: (R, T) -> R): R· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.count(): Long· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.none(): Boolean· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.elementAtOrNone(index: Long): T?· scoop:scoop.std:0.1.0public infix fun <T> Iterable<T>.intersect(other: Iterable<T>): Set<T> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.mapTo(destination: MutableList<R>, transform: (T) -> R): MutableList<R>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.reversed(): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.drop(count: Long): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.reduce(operation: (T, T) -> T): T· scoop:scoop.std:0.1.0public fun <K, V> Iterable<(K, V)>.toMap(): Map<K, V> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.all(predicate: (T) -> Boolean): Boolean· scoop:scoop.std:0.1.0public fun <T : Compare<T>> Iterable<T>.sortedDescending(): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.elementAt(index: Long): T· scoop:scoop.std:0.1.0public fun <K, V> Iterable<(K, V)>.toMutableMap(): MutableMap<K, V> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.filterTo(destination: MutableList<T>, predicate: (T) -> Boolean): MutableList<T>· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.flatMapTo(destination: MutableSet<R>, transform: (T) -> Iterable<R>): MutableSet<R>· scoop:scoop.std:0.1.0public infix fun <T> Iterable<T>.union(other: Iterable<T>): Set<T> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.lastOrNone(predicate: (T) -> Boolean): T?· scoop:scoop.std:0.1.0public operator fun <T : Equals<T>> Iterable<T>.contains(element: T): Boolean· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.filterNot(predicate: (T) -> Boolean): List<T>· scoop:scoop.std:0.1.0public fun <T, K : Compare<K>> Iterable<T>.sortedBy(selector: (T) -> K): List<T>· scoop:scoop.std:0.1.0public fun <T : Compare<T>> Iterable<T>.maxOrNone(): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.lastOrNone(): T?· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.mapTo(destination: MutableSet<R>, transform: (T) -> R): MutableSet<R>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.distinct(): List<T> where T : Equals<T>, T : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.none(predicate: (T) -> Boolean): Boolean· scoop:scoop.std:0.1.0public fun <T, K> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K, T> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T : Compare<T>> Iterable<T>.sorted(): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.filter(predicate: (T) -> Boolean): List<T>· scoop:scoop.std:0.1.0public fun <T, K> Iterable<T>.groupByTo(destination: MutableMap<K, MutableList<T>>, keySelector: (T) -> K): MutableMap<K, MutableList<T>>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.toList(): List<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.maxWithOrNone(comparator: Comparator<T>): T?· scoop:scoop.std:0.1.0public fun <T, K> Iterable<T>.groupBy(keySelector: (T) -> K): Map<K, List<T>> where K : Equals<K>, K : Hash· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.toCollection(destination: MutableList<T>): MutableList<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.firstOrNone(): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.filterTo(destination: MutableSet<T>, predicate: (T) -> Boolean): MutableSet<T>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.singleOrNone(): T?· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.single(): T· scoop:scoop.std:0.1.0public fun <T, R> Iterable<T>.mapIndexed(transform: (Long, T) -> R): List<R>· scoop:scoop.std:0.1.0public fun <T> Iterable<T>.forEachIndexed(action: (Long, T) -> Unit): Unit· scoop:scoop.std:0.1.0
function iterator
source · line 18public
public operator fun iterator(): Iterator<T>
Creates the cursor used to traverse this value.
type parameter T
source · line 14public
T