case class CMSAggregator[K](cmsMonoid: CMSMonoid[K]) extends MonoidAggregator[K, CMS[K], CMS[K]] with Product with Serializable
An Aggregator for CMS. Can be created using CMS.aggregator.
- Alphabetic
- By Inheritance
- CMSAggregator
- Product
- Equals
- MonoidAggregator
- Aggregator
- 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 andThenPresent[D](present2: (CMS[K]) => D): MonoidAggregator[K, CMS[K], D]
Like calling andThen on the present function
Like calling andThen on the present function
- Definition Classes
- MonoidAggregator → Aggregator
- def append(l: CMS[K], r: K): CMS[K]
- Definition Classes
- Aggregator
- def appendAll(items: TraversableOnce[K]): CMS[K]
- Definition Classes
- MonoidAggregator
- def appendAll(old: CMS[K], items: TraversableOnce[K]): CMS[K]
- Definition Classes
- Aggregator
- def apply(inputs: TraversableOnce[K]): CMS[K]
This may error if inputs are empty (for Monoid Aggregators it never will, instead you see present(Monoid.zero[B])
This may error if inputs are empty (for Monoid Aggregators it never will, instead you see present(Monoid.zero[B])
- Definition Classes
- Aggregator
- def applyCumulatively[In <: TraversableOnce[K], Out](inputs: In)(implicit bf: CanBuildFrom[In, CMS[K], Out]): Out
This returns the cumulative sum of its inputs, in the same order.
This returns the cumulative sum of its inputs, in the same order. If the inputs are empty, the result will be empty too.
- Definition Classes
- Aggregator
- def applyOption(inputs: TraversableOnce[K]): Option[CMS[K]]
This returns None if the inputs are empty
This returns None if the inputs are empty
- Definition Classes
- Aggregator
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val cmsMonoid: CMSMonoid[K]
- def collectBefore[A2](fn: PartialFunction[A2, K]): MonoidAggregator[A2, CMS[K], CMS[K]]
Only transform values where the function is defined, else discard
Only transform values where the function is defined, else discard
- Definition Classes
- MonoidAggregator
- def composePrepare[A2](prepare2: (A2) => K): MonoidAggregator[A2, CMS[K], CMS[K]]
Like calling compose on the prepare function
Like calling compose on the prepare function
- Definition Classes
- MonoidAggregator → Aggregator
- def cumulativeIterator(inputs: Iterator[K]): Iterator[CMS[K]]
This returns the cumulative sum of its inputs, in the same order.
This returns the cumulative sum of its inputs, in the same order. If the inputs are empty, the result will be empty too.
- Definition Classes
- Aggregator
- def either[A2, B2, C2](that: MonoidAggregator[A2, B2, C2]): MonoidAggregator[Either[K, A2], (CMS[K], B2), (CMS[K], C2)]
Build a MonoidAggregator that either takes left or right input and outputs the pair from both
Build a MonoidAggregator that either takes left or right input and outputs the pair from both
- Definition Classes
- MonoidAggregator
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def filterBefore[A1 <: K](pred: (A1) => Boolean): MonoidAggregator[A1, CMS[K], CMS[K]]
Only aggregate items that match a predicate
Only aggregate items that match a predicate
- Definition Classes
- MonoidAggregator
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def join[A2 <: K, B2, C2](that: Aggregator[A2, B2, C2]): Aggregator[A2, (CMS[K], B2), (CMS[K], C2)]
This allows you to run two aggregators on the same data with a single pass
This allows you to run two aggregators on the same data with a single pass
- Definition Classes
- Aggregator
- def lift: MonoidAggregator[K, Option[CMS[K]], Option[CMS[K]]]
- Definition Classes
- Aggregator
- val monoid: CMSMonoid[K]
- Definition Classes
- CMSAggregator → MonoidAggregator
- 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()
- def prepare(value: K): CMS[K]
- Definition Classes
- CMSAggregator → Aggregator
- def present(cms: CMS[K]): CMS[K]
- Definition Classes
- CMSAggregator → Aggregator
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def reduce(items: TraversableOnce[CMS[K]]): CMS[K]
This may error if items is empty.
This may error if items is empty. To be safe you might use reduceOption if you don't know that items is non-empty
- Definition Classes
- MonoidAggregator → Aggregator
- def reduce(l: CMS[K], r: CMS[K]): CMS[K]
combine two inner values
combine two inner values
- Definition Classes
- Aggregator
- def reduceOption(items: TraversableOnce[CMS[K]]): Option[CMS[K]]
This is the safe version of the above.
This is the safe version of the above. If the input in empty, return None, else reduce the items
- Definition Classes
- Aggregator
- def semigroup: Monoid[CMS[K]]
- Definition Classes
- MonoidAggregator → Aggregator
- def sumBefore: MonoidAggregator[TraversableOnce[K], CMS[K], CMS[K]]
This maps the inputs to Bs, then sums them, effectively flattening the inputs to the MonoidAggregator
This maps the inputs to Bs, then sums them, effectively flattening the inputs to the MonoidAggregator
- Definition Classes
- MonoidAggregator
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toFold: Fold[K, Option[CMS[K]]]
An Aggregator can be converted to a Fold, but not vice-versa Note, a Fold is more constrained so only do this if you require joining a Fold with an Aggregator to produce a Fold
An Aggregator can be converted to a Fold, but not vice-versa Note, a Fold is more constrained so only do this if you require joining a Fold with an Aggregator to produce a Fold
- Definition Classes
- Aggregator
- 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()
- def zip[A2, B2, C2](ag2: MonoidAggregator[A2, B2, C2]): MonoidAggregator[(K, A2), (CMS[K], B2), (CMS[K], C2)]
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
The law here is: ag1.zip(ag2).apply(as.zip(bs)) == (ag1(as), ag2(bs))
- Definition Classes
- MonoidAggregator
- def zip[A2, B2, C2](ag2: Aggregator[A2, B2, C2]): Aggregator[(K, A2), (CMS[K], B2), (CMS[K], C2)]
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
This allows you to join two aggregators into one that takes a tuple input, which in turn allows you to chain .composePrepare onto the result if you have an initial input that has to be prepared differently for each of the joined aggregators.
The law here is: ag1.zip(ag2).apply(as.zip(bs)) == (ag1(as), ag2(bs))
- Definition Classes
- Aggregator