Batch

indigo.shared.collections.Batch
See theBatch companion object
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.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def head: A
def headOption: Option[A]
def isEmpty: Boolean
def last: A
def lastOption: Option[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 distinct: Batch[A]
def distinctBy[B](f: A => B): Batch[A]
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 flatten[B](using asBatch: 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
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]
def maxBy[B](f: A => B)(using ord: Ordering[B]): A
def maxByOption[B](f: A => B)(using ord: Ordering[B]): Option[A]
def minBy[B](f: A => B)(using ord: Ordering[B]): A
def minByOption[B](f: A => B)(using ord: Ordering[B]): Option[A]
def mkString: String

Converts the batch into a String`

Converts the batch into a String`

Attributes

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

Attributes

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

Attributes

Returns

String

def nonEmpty: Boolean
def padTo[B >: A](len: Int, elem: B): Batch[B]
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 sorted[B >: A](implicit ord: Ordering[B]): Batch[A]
def splitAt(n: Int): (Batch[A], Batch[A])
def sum[B >: A](implicit num: Numeric[B]): B
def tail: Batch[A]
def tailOption: Option[Batch[A]]
def tailOrEmpty: Batch[A]
def take(n: Int): Batch[A]
def takeRight(n: Int): Batch[A]
def takeWhile(p: A => Boolean): 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

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def uncons: Option[(A, Batch[A])]
def update[B >: A](index: Int, value: B): Batch[B]
def zip[B](other: Batch[B]): Batch[(A, B)]
def zipWithIndex: Batch[(A, Int)]
def |+|[B >: A](other: Batch[B]): Batch[B]