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

Extensions for kotlin.collections.Iterable

allA

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

fun <T> Iterable<T>.allA(predicate: (T) -> Attribute<Boolean>): Attribute<Boolean>

anyA

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

fun <T> Iterable<T>.anyA(predicate: (T) -> Attribute<Boolean>): Attribute<Boolean>

associateA

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

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

associateByA

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

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

associateWithA

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

fun <K, V> Iterable<K>.associateWithA(valueSelector: (K) -> Attribute<V>): Attribute<Map<K, V>>

chunked

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

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

contains

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

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

countA

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

fun <T> Iterable<T>.countA(predicate: (T) -> Attribute<Boolean>): Attribute<Int>

distinctByA

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

fun <T, K> Iterable<T>.distinctByA(selector: (T) -> Attribute<K>): Attribute<List<T>>

drop

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

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

dropWhileA

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

fun <T> Iterable<T>.dropWhileA(predicate: (T) -> Attribute<Boolean>): Attribute<List<T>>

elementAt

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

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

elementAtOrElse

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

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

elementAtOrNull

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

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

filterA

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

fun <T> Iterable<T>.filterA(predicate: (T) -> Attribute<Boolean>): Attribute<List<T>>

filterIsInstance

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

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

filterIsInstanceToSet

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

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

filterNotA

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

fun <T> Iterable<T>.filterNotA(predicate: (T) -> Attribute<Boolean>): Attribute<List<T>>

filterNotToSetA

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

fun <T> Iterable<T>.filterNotToSetA(predicate: (T) -> Attribute<Boolean>): Attribute<Set<T>>

filterToSetA

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

fun <T> Iterable<T>.filterToSetA(predicate: (T) -> Attribute<Boolean>): Attribute<Set<T>>

findA

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

fun <T> Iterable<T>.findA(predicate: (T) -> Attribute<Boolean>): Attribute<T?>

findLastA

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

fun <T> Iterable<T>.findLastA(predicate: (T) -> Attribute<Boolean>): Attribute<T?>

firstA

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

fun <T> Iterable<T>.firstA(predicate: (T) -> Attribute<Boolean>): Attribute<T>

firstOrNullA

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

fun <T> Iterable<T>.firstOrNullA(predicate: (T) -> Attribute<Boolean>): Attribute<T?>

flatMapA

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

fun <T, R> Iterable<T>.flatMapA(transform: (T) -> Attribute<Iterable<R>>): Attribute<List<R>>

flatMapToSetA

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

fun <T, R> Iterable<T>.flatMapToSetA(transform: (T) -> Attribute<Iterable<R>>): Attribute<Set<R>>

fold

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

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

foldIndexed

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

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

groupByA

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

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

groupingByA

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

fun <T, K> Iterable<T>.groupingByA(keySelector: (T) -> Attribute<K>): Attribute<Grouping<T, K>>

indexOf

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

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

indexOfFirstA

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

fun <T> Iterable<T>.indexOfFirstA(predicate: (T) -> Attribute<Boolean>): Attribute<Int>

indexOfLastA

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

fun <T> Iterable<T>.indexOfLastA(predicate: (T) -> Attribute<Boolean>): Attribute<Int>

intersect

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

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

joinToString

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

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

joinToStringA

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

fun <T> Iterable<T>.joinToStringA(separator: Attribute<CharSequence>, prefix: Attribute<CharSequence> = com.femastudios.dataflow.async.util.attributeOf(""), postfix: Attribute<CharSequence> = com.femastudios.dataflow.async.util.attributeOf(""), limit: Attribute<Int> = com.femastudios.dataflow.async.util.attributeOf(-1), truncated: Attribute<CharSequence> = com.femastudios.dataflow.async.util.attributeOf("..."), transform: (T) -> Attribute<CharSequence>): Attribute<String>
fun <T> Iterable<T>.joinToStringA(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (T) -> Attribute<CharSequence>): Attribute<String>

lastA

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

fun <T> Iterable<T>.lastA(predicate: (T) -> Attribute<Boolean>): Attribute<T>

lastIndexOf

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

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

lastOrNullA

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

fun <T> Iterable<T>.lastOrNullA(predicate: (T) -> Attribute<Boolean>): Attribute<T?>

mapA

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

fun <T, R> Iterable<T>.mapA(transform: (T) -> Attribute<R>): Attribute<List<R>>

mapNotNullA

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

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

mapNotNullToSetA

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

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

mapToSetA

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

fun <T, R> Iterable<T>.mapToSetA(transform: (T) -> Attribute<R>): Attribute<Set<R>>

maxByA

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

fun <T, R : Comparable<R>> Iterable<T>.maxByA(selector: (T) -> Attribute<R>): Attribute<T?>

minByA

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

fun <T, R : Comparable<R>> Iterable<T>.minByA(selector: (T) -> Attribute<R>): Attribute<T?>

minus

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

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

noneA

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

fun <T> Iterable<T>.noneA(predicate: (T) -> Attribute<Boolean>): Attribute<Boolean>

partitionA

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

fun <T> Iterable<T>.partitionA(predicate: (T) -> Attribute<Boolean>): Attribute<Pair<List<T>, List<T>>>

plus

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

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

singleA

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

fun <T> Iterable<T>.singleA(predicate: (T) -> Attribute<Boolean>): Attribute<T>

singleOrNullA

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

fun <T> Iterable<T>.singleOrNullA(predicate: (T) -> Attribute<Boolean>): Attribute<T?>

sorted

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

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

sortedBy

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

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

sortedByA

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

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

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

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

sortedByDescendingA

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

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

subtract

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

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

sumByA

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

fun <T> Iterable<T>.sumByA(selector: (T) -> Attribute<Int>): Attribute<Int>

sumByDoubleA

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

fun <T> Iterable<T>.sumByDoubleA(selector: (T) -> Attribute<Double>): Attribute<Double>

take

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

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

takeWhileA

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

fun <T> Iterable<T>.takeWhileA(predicate: (T) -> Attribute<Boolean>): Attribute<List<T>>

union

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

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

windowed

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

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

zip

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

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

zipWithA

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

fun <T, R> Iterable<T>.zipWithA(pairProvider: (T) -> Attribute<R>): Attribute<List<Pair<T, R>>>