Documentation / dataflow-async / com.femastudios.dataflow.async.extensions / kotlin.sequences.Sequence
Go to reference

Extensions for kotlin.sequences.Sequence

chunked

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

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

contains

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

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

drop

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

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

elementAt

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

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

elementAtOrElse

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

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

elementAtOrNull

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

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

filterIsInstance

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

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

filterIsInstanceToSet

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

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

fold

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

fun <T, R> Sequence<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> Sequence<T>.foldIndexed(initial: Attribute<R>, operation: (index: Int, acc: R, T) -> R): Attribute<R>

indexOf

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

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

joinToString

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

fun <T> Sequence<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>

lastIndexOf

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

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

minus

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

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

plus

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

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

sorted

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

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

sortedBy

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

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

take

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

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

windowed

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

fun <T> Sequence<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<Sequence<List<T>>>
fun <T, R> Sequence<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<Sequence<R>>

zip

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

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