kactoos-jvm / nnl.rocks.kactoos.scalar / ItemAt / <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.
fallback - Fallback value
source - IterableItemAt(position: Int, source: Iterable<T>)
Ctor.
position - Position
source - IterableItemAt(position: Int, source: Iterator<T>)
Ctor.
position - Position
source - Iterable
Since 0.21
ItemAt(source: Iterable<T>, position: Int, fallback: Func<Iterable<T>, T>)
Ctor.
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.
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.
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.
T - KScalar type
Since 0.3