Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / ItemAt / <init>

<init>

ItemAt(src: Scalar<Iterator<T>>, pos: Int, fbk: Func<Iterable<T>, T>)ItemAt(fallback: T, source: Iterable<T>) ItemAt(source: Iterable<T>, fallback: Func<Iterable<T>, T> = FuncOf { throw IOException("The iterable is empty") })

Ctor.

Parameters

fallback - Fallback value

source - IterableItemAt(position: Int, source: Iterable<T>)

Ctor.

Parameters

position - Position

source - IterableItemAt(position: Int, source: Iterator<T>)

Ctor.

Parameters

position - Position

source - Iterable

Since 0.21

ItemAt(source: Iterable<T>, position: Int, fallback: Func<Iterable<T>, T>)

Ctor.

Parameters

source - Iterable

position - Position

fallback - Fallback valueItemAt(iterator: Iterator<T>, fallback: T) ItemAt(iterator: Iterator<T>, fallback: Func<Iterable<T>, T> = FuncOf { throw IOException("Iterator is empty") })

Ctor.

Parameters

iterator - Iterator

fallback - Fallback valueItemAt(iterator: Iterator<T>, position: Int, fallback: Func<Iterable<T>, T> = FuncOf { throw IOException( FormattedText( "Iterator doesn't have an element at #%d position", position ).asString() ) })

Ctor.

Parameters

iterator - Iterator

position - Position

fallback - Fallback valueItemAt(src: KScalar<Iterator<T>>, pos: Int, fbk: Func<Iterable<T>, T>)

Element from position in Iterator or fallback value if iterator hasn’t this position.

There is no thread-safety guarantee.

Parameters

T - KScalar type

Since 0.3