我刚才输入这个似乎有点难看:如何DateTimeComparator转换为订购[DATETIME]在斯卡拉
val maxTime = times.max(DateTimeComparator.getInstance().asInstanceOf[Comparator[DateTime]] asScala)
times
是org.joda.time.DateTime的序列。
必须有更好的方法来获得DateTime的Ordering对象。在那儿?
尤其是它会是巨大的,失去了asInstanceOf ...
请参考[?如何定义在Scala中的排序] (http://stackoverflow.com/questions/9061141/how-to-define-an-ordering-in-scala) – 2016-11-11 19:16:55