Permalink
Browse files

734: moved package objects to package.scala files

  • Loading branch information...
1 parent bb55de4 commit 2214c7fc88845ecf4cd4fe9790834bc4a17b316a patriknw committed Apr 5, 2011
@@ -317,26 +317,6 @@ class FiniteDuration(val length: Long, val unit: TimeUnit) extends Duration {
override def hashCode = toNanos.asInstanceOf[Int]
}
-package object duration {
- implicit def intToDurationInt(n: Int) = new DurationInt(n)
- implicit def longToDurationLong(n: Long) = new DurationLong(n)
- implicit def doubleToDurationDouble(d: Double) = new DurationDouble(d)
-
- implicit def pairIntToDuration(p : (Int, TimeUnit)) = Duration(p._1, p._2)
- implicit def pairLongToDuration(p : (Long, TimeUnit)) = Duration(p._1, p._2)
- implicit def durationToPair(d : Duration) = (d.length, d.unit)
-
- implicit def intMult(i : Int) = new {
- def *(d : Duration) = d * i
- }
- implicit def longMult(l : Long) = new {
- def *(d : Duration) = d * l
- }
- implicit def doubleMult(f : Double) = new {
- def *(d : Duration) = d * f
- }
-}
-
class DurationInt(n: Int) {
def nanoseconds = Duration(n, NANOSECONDS)
def nanos = Duration(n, NANOSECONDS)
@@ -0,0 +1,27 @@
+/**
+ * Copyright (C) 2009-2011 Scalable Solutions AB <http://scalablesolutions.se>
+ */
+
+package akka.util
+
+import java.util.concurrent.TimeUnit
+
+package object duration {
+ implicit def intToDurationInt(n: Int) = new DurationInt(n)
+ implicit def longToDurationLong(n: Long) = new DurationLong(n)
+ implicit def doubleToDurationDouble(d: Double) = new DurationDouble(d)
+
+ implicit def pairIntToDuration(p : (Int, TimeUnit)) = Duration(p._1, p._2)
+ implicit def pairLongToDuration(p : (Long, TimeUnit)) = Duration(p._1, p._2)
+ implicit def durationToPair(d : Duration) = (d.length, d.unit)
+
+ implicit def intMult(i : Int) = new {
+ def *(d : Duration) = d * i
+ }
+ implicit def longMult(l : Long) = new {
+ def *(d : Duration) = d * l
+ }
+ implicit def doubleMult(f : Double) = new {
+ def *(d : Duration) = d * f
+ }
+}

0 comments on commit 2214c7f

Please sign in to comment.