1
package nl.ndervorst.commons.scalapimps
3
trait Adapter[X] {self =>
10
implicit def adaptee[Adaptee](adapter: Adapter[Adaptee]) = adapter.adaptee
16
def zipMerge[E](it1: Iterable[E], it2: Iterable[E])(implicit o: Ordering[E]): Iterable[(Option[E], Option[E])] = null
20
class Series[X: Ordering, Y](val adaptee: Iterable[(X, Y)]) extends Adapter[Iterable[(X, Y)]] {
21
val order = implicitly[Ordering[X]]
22
def zipMerge(other: Series[X, Y]): Series[X, (Option[Y], Option[Y])] = IterableW.zipMerge(this, other)(new Ordering[(X, Y)] {
23
def compare(xy1: (X, Y), xy2: (X, Y)) = order.compare(xy1._1, xy2._1)
31
implicit def wrap[X: Ordering, Y](itble: Iterable[(X, Y)]): Series[X, Y] = new Series(itble)