ArrayCursor

final class ArrayCursor[@specialized(Boolean, Byte, Char, Int, Long, Double) A](_array: Array[A], _offset: Int, _length: Int, newBuilder: () => ArrayBuilder[A]) extends BatchCursor[A]

BatchCursor type that works over an underlying Array.

BatchCursor type that works over an underlying Array.

NOTE: all transformations happen by copying from the source array into a modified copy, hence all transformations have strict behavior!

To build an instance, prefer BatchCursor.fromArray.

class BatchCursor[A]
trait Serializable
class Object
trait Matchable
class Any

Value members

Constructors

def this(array: Array[A], offset: Int, length: Int)(tag: ClassTag[A])
def this(array: Array[A])(tag: ClassTag[A])

Concrete methods

def array: Array[A]
override def collect[B](pf: PartialFunction[A, B]): ArrayCursor[B]
Definition Classes
override def drop(n: Int): ArrayCursor[A]
Definition Classes
override def filter(p: A => Boolean): ArrayCursor[A]
Definition Classes
override def hasNext(): Boolean
Definition Classes
def length: Int
override def map[B](f: A => B): ArrayCursor[B]
Definition Classes
override def next(): A
Definition Classes
def offset: Int
override def slice(from: Int, until: Int): ArrayCursor[A]
Definition Classes
override def take(n: Int): ArrayCursor[A]
Definition Classes
override def toBatch: Batch[A]
Definition Classes
override def toIterator: Iterator[A]
Definition Classes

Inherited methods

def foldLeft[R](initial: R)(op: (R, A) => R): R

Applies a binary operator to a start value and all elements of this cursor, going left to right.

Applies a binary operator to a start value and all elements of this cursor, going left to right.

NOTE: applying this function on the cursor will consume it completely.

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 cursor, going left to right with the start value initial on the left. Returns initial if the cursor is empty.

Inherited from
BatchCursor
def isEmpty: Boolean

Returns true in case our cursor is empty or false if there are more elements to process.

Returns true in case our cursor is empty or false if there are more elements to process.

Alias for !cursor.hasNext().

Inherited from
BatchCursor
def nonEmpty: Boolean

Returns true in case our cursor has more elements to process or false if the cursor is empty.

Returns true in case our cursor has more elements to process or false if the cursor is empty.

Alias for hasNext.

Inherited from
BatchCursor
def toArray[B >: A](`evidence$1`: ClassTag[B]): Array[B]

Converts this cursor into an Array, consuming it in the process.

Converts this cursor into an Array, consuming it in the process.

Inherited from
BatchCursor
def toList: List[A]

Converts this cursor into a Scala immutable List, consuming it in the process.

Converts this cursor into a Scala immutable List, consuming it in the process.

Inherited from
BatchCursor

Concrete fields

override val recommendedBatchSize: Int