Documentation / dataflow-async / com.femastudios.dataflow.async.extensions / elementAtOrElse
Go to reference

elementAtOrElse

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

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

Calling this function is equivalent to use transform and calling elementAtOrElse in the transformation function.

This is simply a convenience function.

See Also

kotlin.collections.elementAtOrElse


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

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

Calling this function is equivalent to use transform and calling elementAtOrElse in the transformation function.

This is simply a convenience function.

See Also

kotlin.sequences.elementAtOrElse


fun Attribute<String>.elementAtOrElse(index: Attribute<Int>, defaultValue: (Int) -> Char): Attribute<Char>
fun Attribute<String>.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Attribute<Char>

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

Calling this function is equivalent to use transform and calling elementAtOrElse in the transformation function.

This is simply a convenience function.

See Also

kotlin.text.elementAtOrElse