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

Extensions for kotlin.sequences.Sequence

chunked

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

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

contains

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

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

drop

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

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

elementAt

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

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

elementAtOrElse

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

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

elementAtOrNull

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

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

filterIsInstance

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

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

filterIsInstanceToSet

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

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

fold

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

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

indexOf

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

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

joinToString

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

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

lastIndexOf

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

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

minus

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

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

plus

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

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

sorted

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

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

sortedBy

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

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

take

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

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

windowed

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

fun <T> Sequence<T>.windowed(size: Field<Int>, step: Field<Int> = com.femastudios.dataflow.util.fieldOf(1), partialWindows: Field<Boolean> = com.femastudios.dataflow.util.fieldOf(false)): Field<Sequence<List<T>>>
fun <T, R> Sequence<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<Sequence<R>>

zip

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

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