Documentation / dataflow / com.femastudios.dataflow.extensions / kotlin.collections.Iterable
Go to reference

Extensions for kotlin.collections.Iterable

allF

Same as all, but accepts Field and returns a new Field.

fun <T> Iterable<T>.allF(predicate: (T) -> Field<Boolean>): Field<Boolean>

anyF

Same as any, but accepts Field and returns a new Field.

fun <T> Iterable<T>.anyF(predicate: (T) -> Field<Boolean>): Field<Boolean>

associateByF

Same as associateBy, but accepts Field and returns a new Field.

fun <T, K, V> Iterable<T>.associateByF(keySelector: (T) -> Field<K>, valueTransform: (T) -> Field<V>): Field<Map<K, V>>
fun <T, K> Iterable<T>.associateByF(keySelector: (T) -> Field<K>): Field<Map<K, T>>

associateF

Same as associate, but accepts Field and returns a new Field.

fun <T, K, V> Iterable<T>.associateF(transform: (T) -> Field<Pair<K, V>>): Field<Map<K, V>>

associateWithF

Same as associateWith, but accepts Field and returns a new Field.

fun <K, V> Iterable<K>.associateWithF(valueSelector: (K) -> Field<V>): Field<Map<K, V>>

chunked

Same as chunked, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.chunked(size: Field<Int>, transform: (List<T>) -> R): Field<List<R>>
fun <T> Iterable<T>.chunked(size: Field<Int>): Field<List<List<T>>>

contains

Same as contains, but accepts Field and returns a new Field.

fun <T> Iterable<T>.contains(element: Field<T>): Field<Boolean>

countF

Same as count, but accepts Field and returns a new Field.

fun <T> Iterable<T>.countF(predicate: (T) -> Field<Boolean>): Field<Int>

distinctByF

Same as distinctBy, but accepts Field and returns a new Field.

fun <T, K> Iterable<T>.distinctByF(selector: (T) -> Field<K>): Field<List<T>>

drop

Same as drop, but accepts Field and returns a new Field.

fun <T> Iterable<T>.drop(n: Field<Int>): Field<List<T>>

dropWhileF

Same as dropWhile, but accepts Field and returns a new Field.

fun <T> Iterable<T>.dropWhileF(predicate: (T) -> Field<Boolean>): Field<List<T>>

elementAt

Same as elementAt, but accepts Field and returns a new Field.

fun <T> Iterable<T>.elementAt(index: Field<Int>): Field<T>

elementAtOrElse

Same as elementAtOrElse, but accepts Field and returns a new Field.

fun <T> Iterable<T>.elementAtOrElse(index: Field<Int>, defaultValue: (Int) -> T): Field<T>

elementAtOrNull

Same as elementAtOrNull, but accepts Field and returns a new Field.

fun <T> Iterable<T>.elementAtOrNull(index: Field<Int>): Field<T?>

filterF

Same as filter, but accepts Field and returns a new Field.

fun <T> Iterable<T>.filterF(predicate: (T) -> Field<Boolean>): Field<List<T>>

filterIsInstance

Same as filterIsInstance, but accepts Field and returns a new Field.

fun <R> Iterable<*>.filterIsInstance(klass: Field<Class<R>>): Field<List<R>>

filterIsInstanceToSet

Same as filterIsInstanceToSet, but accepts Field and returns a new Field.

fun <R> Iterable<*>.filterIsInstanceToSet(klass: Field<Class<R>>): Field<Set<R>>

filterNotF

Same as filterNot, but accepts Field and returns a new Field.

fun <T> Iterable<T>.filterNotF(predicate: (T) -> Field<Boolean>): Field<List<T>>

filterNotToSetF

Same as filterNotToSet, but accepts Field and returns a new Field.

fun <T> Iterable<T>.filterNotToSetF(predicate: (T) -> Field<Boolean>): Field<Set<T>>

filterToSetF

Same as filterToSet, but accepts Field and returns a new Field.

fun <T> Iterable<T>.filterToSetF(predicate: (T) -> Field<Boolean>): Field<Set<T>>

findF

Same as find, but accepts Field and returns a new Field.

fun <T> Iterable<T>.findF(predicate: (T) -> Field<Boolean>): Field<T?>

findLastF

Same as findLast, but accepts Field and returns a new Field.

fun <T> Iterable<T>.findLastF(predicate: (T) -> Field<Boolean>): Field<T?>

firstF

Same as first, but accepts Field and returns a new Field.

fun <T> Iterable<T>.firstF(predicate: (T) -> Field<Boolean>): Field<T>

firstOrNullF

Same as firstOrNull, but accepts Field and returns a new Field.

fun <T> Iterable<T>.firstOrNullF(predicate: (T) -> Field<Boolean>): Field<T?>

flatMapF

Same as flatMap, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.flatMapF(transform: (T) -> Field<Iterable<R>>): Field<List<R>>

flatMapToSetF

Same as flatMapToSet, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.flatMapToSetF(transform: (T) -> Field<Iterable<R>>): Field<Set<R>>

fold

Same as fold, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.fold(initial: Field<R>, operation: (acc: R, T) -> R): Field<R>

foldIndexed

Same as foldIndexed, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.foldIndexed(initial: Field<R>, operation: (index: Int, acc: R, T) -> R): Field<R>

groupByF

Same as groupBy, but accepts Field and returns a new Field.

fun <T, K, V> Iterable<T>.groupByF(keySelector: (T) -> Field<K>, valueTransform: (T) -> Field<V>): Field<Map<K, List<V>>>
fun <T, K> Iterable<T>.groupByF(keySelector: (T) -> Field<K>): Field<Map<K, List<T>>>

groupingByF

Same as groupingBy, but accepts Field and returns a new Field.

fun <T, K> Iterable<T>.groupingByF(keySelector: (T) -> Field<K>): Field<Grouping<T, K>>

indexOf

Same as indexOf, but accepts Field and returns a new Field.

fun <T> Iterable<T>.indexOf(element: Field<T>): Field<Int>

indexOfFirstF

Same as indexOfFirst, but accepts Field and returns a new Field.

fun <T> Iterable<T>.indexOfFirstF(predicate: (T) -> Field<Boolean>): Field<Int>

indexOfLastF

Same as indexOfLast, but accepts Field and returns a new Field.

fun <T> Iterable<T>.indexOfLastF(predicate: (T) -> Field<Boolean>): Field<Int>

intersect

Same as intersect, but accepts Field and returns a new Field.

infix fun <T> Iterable<T>.intersect(other: Field<Iterable<T>>): Field<Set<T>>

joinToString

Same as joinToString, but accepts Field and returns a new Field.

fun <T> Iterable<T>.joinToString(separator: Field<CharSequence>, prefix: Field<CharSequence> = com.femastudios.dataflow.util.fieldOf(""), postfix: Field<CharSequence> = com.femastudios.dataflow.util.fieldOf(""), limit: Field<Int> = com.femastudios.dataflow.util.fieldOf(-1), truncated: Field<CharSequence> = com.femastudios.dataflow.util.fieldOf("..."), transform: ((T) -> CharSequence)? = null): Field<String>

joinToStringF

Same as joinToString, but accepts Field and returns a new Field.

fun <T> Iterable<T>.joinToStringF(separator: Field<CharSequence>, prefix: Field<CharSequence> = com.femastudios.dataflow.util.fieldOf(""), postfix: Field<CharSequence> = com.femastudios.dataflow.util.fieldOf(""), limit: Field<Int> = com.femastudios.dataflow.util.fieldOf(-1), truncated: Field<CharSequence> = com.femastudios.dataflow.util.fieldOf("..."), transform: (T) -> Field<CharSequence>): Field<String>
fun <T> Iterable<T>.joinToStringF(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (T) -> Field<CharSequence>): Field<String>

lastF

Same as last, but accepts Field and returns a new Field.

fun <T> Iterable<T>.lastF(predicate: (T) -> Field<Boolean>): Field<T>

lastIndexOf

Same as lastIndexOf, but accepts Field and returns a new Field.

fun <T> Iterable<T>.lastIndexOf(element: Field<T>): Field<Int>

lastOrNullF

Same as lastOrNull, but accepts Field and returns a new Field.

fun <T> Iterable<T>.lastOrNullF(predicate: (T) -> Field<Boolean>): Field<T?>

mapF

Same as map, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.mapF(transform: (T) -> Field<R>): Field<List<R>>

mapNotNullF

Same as mapNotNull, but accepts Field and returns a new Field.

fun <T, R : Any> Iterable<T>.mapNotNullF(transform: (T) -> Field<R?>): Field<List<R>>

mapNotNullToSetF

Same as mapNotNullToSet, but accepts Field and returns a new Field.

fun <T, R : Any> Iterable<T>.mapNotNullToSetF(transform: (T) -> Field<R?>): Field<Set<R>>

mapToSetF

Same as mapToSet, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.mapToSetF(transform: (T) -> Field<R>): Field<Set<R>>

maxByF

Same as maxBy, but accepts Field and returns a new Field.

fun <T, R : Comparable<R>> Iterable<T>.maxByF(selector: (T) -> Field<R>): Field<T?>

minByF

Same as minBy, but accepts Field and returns a new Field.

fun <T, R : Comparable<R>> Iterable<T>.minByF(selector: (T) -> Field<R>): Field<T?>

minus

Same as minus, but accepts Field and returns a new Field.

operator fun <T> Iterable<T>.minus(elements: Field<Array<out T>>): Field<List<T>>
operator fun <T> Iterable<T>.minus(element: Field<T>): Field<List<T>>
operator fun <T> Iterable<T>.minus(elements: Field<Sequence<T>>): Field<List<T>>
operator fun <T> Iterable<T>.minus(elements: Field<Iterable<T>>): Field<List<T>>

noneF

Same as none, but accepts Field and returns a new Field.

fun <T> Iterable<T>.noneF(predicate: (T) -> Field<Boolean>): Field<Boolean>

partitionF

Same as partition, but accepts Field and returns a new Field.

fun <T> Iterable<T>.partitionF(predicate: (T) -> Field<Boolean>): Field<Pair<List<T>, List<T>>>

plus

Same as plus, but accepts Field and returns a new Field.

operator fun <T> Iterable<T>.plus(elements: Field<Array<out T>>): Field<List<T>>
operator fun <T> Iterable<T>.plus(element: Field<T>): Field<List<T>>
operator fun <T> Iterable<T>.plus(elements: Field<Sequence<T>>): Field<List<T>>
operator fun <T> Iterable<T>.plus(elements: Field<Iterable<T>>): Field<List<T>>

singleF

Same as single, but accepts Field and returns a new Field.

fun <T> Iterable<T>.singleF(predicate: (T) -> Field<Boolean>): Field<T>

singleOrNullF

Same as singleOrNull, but accepts Field and returns a new Field.

fun <T> Iterable<T>.singleOrNullF(predicate: (T) -> Field<Boolean>): Field<T?>

sorted

Same as sorted, but accepts Field and returns a new Field.

fun <T : Comparable<T>> Iterable<T>.sorted(descending: Field<Boolean>): Field<List<T>>

sortedBy

Same as sortedBy, but accepts Field and returns a new Field.

fun <I, C : Comparable<C>> Iterable<I>.sortedBy(descending: Field<Boolean>, selector: (I) -> C?): Field<List<I>>

sortedByDescendingF

Same as sortedByDescending, but accepts Field and returns a new Field.

fun <T, R : Comparable<R>> Iterable<T>.sortedByDescendingF(selector: (T) -> Field<R?>): Field<List<T>>

sortedByF

Same as sortedBy, but accepts Field and returns a new Field.

fun <I, C : Comparable<C>> Iterable<I>.sortedByF(descending: Field<Boolean>, selector: (I) -> Field<C?>): Field<List<I>>
fun <I, C : Comparable<C>> Iterable<I>.sortedByF(descending: Boolean, selector: (I) -> Field<C?>): Field<List<I>>

Same as sortedBy, but accepts Field and returns a new Field.

fun <T, R : Comparable<R>> Iterable<T>.sortedByF(selector: (T) -> Field<R?>): Field<List<T>>

subtract

Same as subtract, but accepts Field and returns a new Field.

infix fun <T> Iterable<T>.subtract(other: Field<Iterable<T>>): Field<Set<T>>

sumByDoubleF

Same as sumByDouble, but accepts Field and returns a new Field.

fun <T> Iterable<T>.sumByDoubleF(selector: (T) -> Field<Double>): Field<Double>

sumByF

Same as sumBy, but accepts Field and returns a new Field.

fun <T> Iterable<T>.sumByF(selector: (T) -> Field<Int>): Field<Int>

take

Same as take, but accepts Field and returns a new Field.

fun <T> Iterable<T>.take(n: Field<Int>): Field<List<T>>

takeWhileF

Same as takeWhile, but accepts Field and returns a new Field.

fun <T> Iterable<T>.takeWhileF(predicate: (T) -> Field<Boolean>): Field<List<T>>

union

Same as union, but accepts Field and returns a new Field.

infix fun <T> Iterable<T>.union(other: Field<Iterable<T>>): Field<Set<T>>

windowed

Same as windowed, but accepts Field and returns a new Field.

fun <T> Iterable<T>.windowed(size: Field<Int>, step: Field<Int> = com.femastudios.dataflow.util.fieldOf(1), partialWindows: Field<Boolean> = com.femastudios.dataflow.util.fieldOf(false)): Field<List<List<T>>>
fun <T, R> Iterable<T>.windowed(size: Field<Int>, step: Field<Int> = com.femastudios.dataflow.util.fieldOf(1), partialWindows: Field<Boolean> = com.femastudios.dataflow.util.fieldOf(false), transform: (List<T>) -> R): Field<List<R>>

zip

Same as zip, but accepts Field and returns a new Field.

fun <T, R, V> Iterable<T>.zip(other: Field<Iterable<R>>, transform: (a: T, b: R) -> V): Field<List<V>>
infix fun <T, R> Iterable<T>.zip(other: Field<Iterable<R>>): Field<List<Pair<T, R>>>
fun <T, R, V> Iterable<T>.zip(other: Field<Array<out R>>, transform: (a: T, b: R) -> V): Field<List<V>>
infix fun <T, R> Iterable<T>.zip(other: Field<Array<out R>>): Field<List<Pair<T, R>>>

zipWithF

Same as zipWith, but accepts Field and returns a new Field.

fun <T, R> Iterable<T>.zipWithF(pairProvider: (T) -> Field<R>): Field<List<Pair<T, R>>>