Batch

sealed trait Batch[+A]

Batch is a really thin wrapper over js.Array to replace List on the Indigo APIs. Its purpose is to provide fast scene construction and fast conversion back to js.Array for the engine to use. Most operations that require any sort of traversal are performed by flattening the structure and delegated to js.Array. In practice, scene construction is mostly about building the structure, so the penalty is acceptable, and still faster than using List.

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def head: A
def size: Int
def toJSArray[B >: A]: Array[B]

Concrete methods

def ++[B >: A](other: Batch[B]): Batch[B]
def +:[B >: A](value: B): Batch[B]
def :+[B >: A](value: B): Batch[B]
def ::[B >: A](value: B): Batch[B]
def apply(index: Int): A
def collect[B >: A, C](f: PartialFunction[B, C]): Batch[C]
def collectFirst[B >: A, C](f: PartialFunction[B, C]): Option[C]
def compact[B >: A]: Wrapped[B]
def contains[B >: A](p: B): Boolean
def drop(count: Int): Batch[A]
def dropRight(count: Int): Batch[A]
def exists(p: A => Boolean): Boolean
def filter(p: A => Boolean): Batch[A]
def filterNot(p: A => Boolean): Batch[A]
def find(p: A => Boolean): Option[A]
def flatMap[B](f: A => Batch[B]): Batch[B]
def fold[B >: A](z: B)(f: (B, B) => B): B
def foldLeft[B](z: B)(f: (B, A) => B): B
def foldRight[B](z: B)(f: (A, B) => B): B
def forall(p: A => Boolean): Boolean
def foreach(f: A => Unit): Unit
@SuppressWarnings(scala.Array.apply[java.lang.String]("scalafix:DisableSyntax.var")(scala.reflect.ClassTag.apply[java.lang.String](classOf[java.lang.String])))
def foreachWithIndex(f: (A, Int) => Unit): Unit
def groupBy[K](f: A => K): Map[K, Batch[A]]
def insert[B >: A](index: Int, value: B): Batch[B]
def length: Int
def lengthCompare(len: Int): Int
def lift(index: Int): Option[A]
def map[B](f: A => B): Batch[B]

Delegates to mkString(separator: String): String

Delegates to mkString(separator: String): String

Returns:

String

def mkString(separator: String): String

Converts the batch into a String

Converts the batch into a String

Value parameters:
separator

A string to add between the elements

Returns:

String

def mkString(prefix: String, separator: String, suffix: String): String

Converts the batch into a String

Converts the batch into a String

Value parameters:
prefix

A string to add before the elements

separator

A string to add between the elements

suffix

A string to add after the elements

Returns:

String

def partition(p: A => Boolean): (Batch[A], Batch[A])
def reduce[B >: A](f: (B, B) => B): B
def reverse: Batch[A]
def sortBy[B](f: A => B)(implicit ord: Ordering[B]): Batch[A]
def sortWith(f: (A, A) => Boolean): Batch[A]
def splitAt(n: Int): (Batch[A], Batch[A])
def sum[B >: A](implicit num: Numeric[B]): B
def tail: Batch[A]
def toArray[B >: A : ClassTag]: Array[B]
def toList: List[A]
def toMap[K, V](using A <:< (K, V)): Map[K, V]
def toSet[B >: A]: Set[B]
override def toString: String
Definition Classes
Any
def update[B >: A](index: Int, value: B): Batch[B]
def zip[B](other: Batch[B]): Batch[(A, B)]
def |+|[B >: A](other: Batch[B]): Batch[B]