The Batch
is a BatchCursor factory, similar in spirit
with Scala's Iterable.
The Batch
is a BatchCursor factory, similar in spirit
with Scala's Iterable.
Its cursor() method can be called repeatedly to yield the same sequence.
This class is provided as an alternative to Scala's Iterable because:
- the list of supported operations is smaller
- implementations specialized for primitives are provided to avoid boxing
- it's a factory of BatchCursor, which provides hints
for
recommendedBatchSize
, meaning how many batch can be processed in a batches
Used in the Iterant implementation.
- Companion
- object
Value members
Abstract methods
Creates a generator by transforming values produced by the source with a partial function, dropping those values for which the partial function is not defined.
Creates a generator by transforming values produced by the source with a partial function, dropping those values for which the partial function is not defined.
- Value Params
- pf
the partial function which filters and maps the generator.
- Returns
a new generator which yields each value
x
produced by this generator for whichpf
is defined
Creates a new generator from the source, with the first
n
elements dropped, of if n
is higher than the length
of the underlying collection, the it mirrors the source,
whichever applies.
Creates a new generator from the source, with the first
n
elements dropped, of if n
is higher than the length
of the underlying collection, the it mirrors the source,
whichever applies.
Returns a generator over all the elements of the source
that satisfy the predicate p
. The order of the elements
is preserved.
Returns a generator over all the elements of the source
that satisfy the predicate p
. The order of the elements
is preserved.
- Value Params
- p
the predicate used to test values.
- Returns
a generator which produces those values of the source which satisfy the predicate
p
.
Applies a binary operator to a start value and all elements of this generator, going left to right.
Applies a binary operator to a start value and all elements of this generator, going left to right.
- Type Params
- R
is the result type of the binary operator.
- Value Params
- initial
is the start value.
- op
the binary operator to apply
- Returns
the result of inserting
op
between consecutive elements of this generator, going left to right with the start valueinitial
on the left. Returnsinitial
if the generator is empty.
Creates a new generator that maps all values produced by the source to new values using a transformation function.
Creates a new generator that maps all values produced by the source to new values using a transformation function.
- Value Params
- f
is the transformation function
- Returns
a new generator which transforms every value produced by the source by applying the function
f
to it.
Creates a new generator emitting an interval of the values produced by the source.
Creates a new generator emitting an interval of the values produced by the source.
- Value Params
- from
the index of the first generated element which forms part of the slice.
- until
the index of the first element following the slice.
- Returns
a generator which emits the element of the source past the first
from
elements usingdrop
, and then takesuntil - from
elements, usingtake