All Downloads are FREE. Search and download functionalities are using the official Maven repository.

poly.algebra.conversion.ToJava.scala Maven / Gradle / Ivy

package poly.algebra.conversion

import java.util._
import poly.algebra._

/**
 * @author Tongfei Chen
 */
object ToJava {

  implicit class orderAsJava[T](val o: Order[T]) extends AnyVal {
    def asJavaComparator: Comparator[T] = new Comparator[T] {
      def compare(o1: T, o2: T): Int = o.cmp(o1, o2)
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy