object Batched extends Serializable
- Alphabetic
- By Inheritance
- Batched
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- def aggregator[A, B, C](batchSize: Int, agg: Aggregator[A, B, C]): Aggregator[A, Batched[B], C]
This aggregator batches up
agg
so that all the addition can be performed at once.This aggregator batches up
agg
so that all the addition can be performed at once.It is useful when
sumOption
is much faster than usingplus
(e.g. when there is temporary mutable state used to make summation fast). - def apply[T](t: T): Batched[T]
Constructed a batch from a single value.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compactingMonoid[A](batchSize: Int)(implicit arg0: Monoid[A]): Monoid[Batched[A]]
Compacting monoid for batched values.
Compacting monoid for batched values.
This monoid ensures that the batch's tree structure has fewer than
batchSize
values in it. When more values are added, the tree is compacted usingm
.It's worth noting that
x + 0
here will produce the same sum asx
, but.toList
will produce different lists (one will have an extra zero). - def compactingSemigroup[A](batchSize: Int)(implicit arg0: Semigroup[A]): Semigroup[Batched[A]]
Compacting semigroup for batched values.
Compacting semigroup for batched values.
This semigroup ensures that the batch's tree structure has fewer than
batchSize
values in it. When more values are added, the tree is compacted usings
. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def equiv[A](implicit e: Equiv[A], s: Semigroup[A]): Equiv[Batched[A]]
Equivalence for batches.
Equivalence for batches.
Batches are equivalent if they sum to the same value. Since the free semigroup is associative, it's not correct to take tree structure into account when determining equality.
One thing to note here is that two equivalent batches might produce different lists (for instance, if one of the batches has more zeros in it than another one).
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fold[T](batchSize: Int)(implicit m: Monoid[T]): Fold[T, T]
- def foldOption[T](batchSize: Int)(implicit arg0: Semigroup[T]): Fold[T, Option[T]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def items[T](ts: TraversableOnce[T]): Option[Batched[T]]
Constructed an optional batch from a collection of values.
Constructed an optional batch from a collection of values.
Since batches cannot be empty, this method returns
None
ifts
is empty, andSome(batch)
otherwise. - def monoidAggregator[A, B, C](batchSize: Int, agg: MonoidAggregator[A, B, C]): MonoidAggregator[A, Batched[B], C]
This monoid aggregator batches up
agg
so that all the addition can be performed at once.This monoid aggregator batches up
agg
so that all the addition can be performed at once.It is useful when
sumOption
is much faster than usingplus
(e.g. when there is temporary mutable state used to make summation fast). - 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()
- implicit def semigroup[A]: Semigroup[Batched[A]]
The free semigroup for batched values.
The free semigroup for batched values.
This semigroup just accumulates batches and doesn't ever evaluate them to flatten the tree.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()