abstract class Batch[+A] extends Serializable
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.
- Alphabetic
- By Inheritance
- Batch
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Batch()
Abstract Value Members
-
abstract
def
collect[B](pf: PartialFunction[A, B]): Batch[B]
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.
- pf
the partial function which filters and maps the generator.
- returns
a new generator which yields each value
xproduced by this generator for whichpfis defined
- abstract def cursor(): BatchCursor[A]
-
abstract
def
drop(n: Int): Batch[A]
Creates a new generator from the source, with the first
nelements dropped, of ifnis higher than the length of the underlying collection, the it mirrors the source, whichever applies. -
abstract
def
filter(p: (A) ⇒ Boolean): Batch[A]
Returns a generator over all the elements of the source that satisfy the predicate
p.Returns a generator over all the elements of the source that satisfy the predicate
p. The order of the elements is preserved.- p
the predicate used to test values.
- returns
a generator which produces those values of the source which satisfy the predicate
p.
-
abstract
def
foldLeft[R](initial: R)(op: (R, A) ⇒ R): R
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.
- R
is the result type of the binary operator.
- initial
is the start value.
- op
the binary operator to apply
- returns
the result of inserting
opbetween consecutive elements of this generator, going left to right with the start valueinitialon the left. Returnsinitialif the generator is empty.
-
abstract
def
map[B](f: (A) ⇒ B): Batch[B]
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.
- f
is the transformation function
- returns
a new generator which transforms every value produced by the source by applying the function
fto it.
-
abstract
def
slice(from: Int, until: Int): Batch[A]
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.
- 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
fromelements usingdrop, and then takesuntil - fromelements, usingtake
-
abstract
def
take(n: Int): Batch[A]
Creates a new generator that will only return the first
nelements of the source.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]
Converts this generator into a standard
Array. -
def
toIterable: Iterable[A]
Converts this generator into a Scala
Iterable. -
def
toList: List[A]
Converts this generator into a Scala immutable
List. -
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )