summaryrefslogtreecommitdiff
path: root/src/cldc-library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-01-21 15:26:26 +0000
committermichelou <michelou@epfl.ch>2008-01-21 15:26:26 +0000
commit94a67b3673d466a80362035db6211e5d73e40b79 (patch)
tree4138b2b74ded6285b72fbc2c194a0c86b7387eb9 /src/cldc-library
parentba2bb0f732c192b7639a85a9970022b4a56d76d6 (diff)
downloadscala-94a67b3673d466a80362035db6211e5d73e40b79.tar.gz
scala-94a67b3673d466a80362035db6211e5d73e40b79.tar.bz2
scala-94a67b3673d466a80362035db6211e5d73e40b79.zip
no Liftcode on CLDC too
Diffstat (limited to 'src/cldc-library')
-rw-r--r--src/cldc-library/scala/runtime/RichLong.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cldc-library/scala/runtime/RichLong.scala b/src/cldc-library/scala/runtime/RichLong.scala
new file mode 100644
index 0000000000..da1a827111
--- /dev/null
+++ b/src/cldc-library/scala/runtime/RichLong.scala
@@ -0,0 +1,30 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id: $
+
+
+package scala.runtime
+
+
+final class RichLong(x: Long) extends Proxy with Ordered[Long] {
+
+ // Proxy.self
+ def self: Any = x
+
+ // Ordered[Long].compare
+ def compare(y: Long): Int = if (x < y) -1 else if (x > y) 1 else 0
+
+ def min(y: Long): Long = if (x < y) x else y
+ def max(y: Long): Long = if (x > y) x else y
+ def abs: Long = if (x < 0) -x else x
+
+ def toBinaryString: String = java.lang.Long.toString(x, 2)
+ def toHexString: String = java.lang.Long.toString(x, 16)
+ def toOctalString: String = java.lang.Long.toString(x, 8)
+}