summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-12-08 09:23:12 +0000
committerpaltherr <paltherr@epfl.ch>2003-12-08 09:23:12 +0000
commitaccaee1ce5b4490374cdb192afaab46325984817 (patch)
treec2275fdccb302deafe1fe954ced3d6ee3be4550f
parent5137f0a3ad5d8334f793fd2dd02e955b86399f60 (diff)
downloadscala-accaee1ce5b4490374cdb192afaab46325984817.tar.gz
scala-accaee1ce5b4490374cdb192afaab46325984817.tar.bz2
scala-accaee1ce5b4490374cdb192afaab46325984817.zip
- Revised all value types
-rw-r--r--sources/scala/Boolean.java67
-rw-r--r--sources/scala/Byte.java186
-rw-r--r--sources/scala/Char.java197
-rw-r--r--sources/scala/Double.java67
-rw-r--r--sources/scala/Float.java94
-rw-r--r--sources/scala/Int.java176
-rw-r--r--sources/scala/Long.java143
-rw-r--r--sources/scala/Short.java179
-rw-r--r--sources/scala/Unit.java29
-rw-r--r--sources/scala/runtime/NativeLoop.java2
-rw-r--r--sources/scala/runtime/RunTime.java143
-rw-r--r--sources/scala/tools/scalai/Evaluator.java20
12 files changed, 579 insertions, 724 deletions
diff --git a/sources/scala/Boolean.java b/sources/scala/Boolean.java
index 94c332ed6a..2cb8a6b56e 100644
--- a/sources/scala/Boolean.java
+++ b/sources/scala/Boolean.java
@@ -6,68 +6,47 @@
** |/ **
\* */
-// $OldId: Boolean.java,v 1.19 2002/09/12 21:23:08 paltherr Exp $
// $Id$
package scala;
-/** @meta class extends scala.AnyVal;
- */
public abstract class Boolean extends AnyVal {
- public abstract boolean asBoolean();
+ public final boolean value;
- public boolean $amp$amp(boolean that) {
- return asBoolean() && that;
+ public Boolean(boolean value) {
+ this.value = value;
}
- public boolean $bar$bar(boolean that) {
- return asBoolean() || that;
+ public boolean equals(java.lang.Object other) {
+ return other instanceof Boolean && value == ((Boolean)other).value;
}
-
- public boolean $amp(boolean that) {
- return asBoolean() & that;
- }
-
- public boolean $bar(boolean that) {
- return asBoolean() | that;
+ public int hashCode() {
+ int bits = value ? 1231 : 1237;
+ return bits;
}
-
- public boolean $up(boolean that) {
- return asBoolean() ^ that;
+ public String toString() {
+ return String.valueOf(value);
}
- /** @meta method []scala.Boolean;
- */
- public boolean $bang() {
- return !asBoolean();
- }
+ /** @meta method (scala.Any)scala.Boolean; */
+ public boolean $eq$eq (java.lang.Object other) { return equals(other); }
+ /** @meta method (scala.Any)scala.Boolean; */
+ public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- public boolean $eq$eq(boolean that) {
- return asBoolean() == that;
- }
+ /** @meta method []scala.Boolean; */
+ public boolean $bang ( ) { return !value ; }
- public boolean $bang$eq(boolean that) {
- return asBoolean() != that;
- }
- public String toString() {
- return String.valueOf(asBoolean());
- }
- public int hashCode() {
- return asBoolean() ? 1231 : 1237;
- }
- public boolean equals(java.lang.Object obj) {
- return obj instanceof Boolean && $eq$eq(((Boolean)obj).asBoolean());
- }
- /** @meta method (scala.Any)scala.Boolean;
- */
- public boolean $eq$eq(java.lang.Object obj) { return equals(obj); }
+ public boolean $eq$eq (boolean that) { return value == that; }
+ public boolean $bang$eq (boolean that) { return value != that; }
+ public boolean $bar$bar (boolean that) { return value || that; }
+ public boolean $amp$amp (boolean that) { return value && that; }
+ public boolean $bar (boolean that) { return value | that; }
+ public boolean $amp (boolean that) { return value & that; }
+ public boolean $up (boolean that) { return value ^ that; }
- /** @meta method (scala.Any)scala.Boolean;
- */
- public boolean $bang$eq(java.lang.Object obj) { return !equals(obj); }
}
diff --git a/sources/scala/Byte.java b/sources/scala/Byte.java
index 13dc8bd036..18a9dc5e9c 100644
--- a/sources/scala/Byte.java
+++ b/sources/scala/Byte.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Byte extends AnyVal {
-
- /** @meta method []scala.Short ; */
- public short coerce() { return asShort (); }
- /** @meta method []scala.Int ; */
- public int coerce() { return asInt (); }
- /** @meta method []scala.Long ; */
- public long coerce() { return asLong (); }
- /** @meta method []scala.Float ; */
- public float coerce() { return asFloat (); }
- /** @meta method []scala.Double; */
- public double coerce() { return asDouble(); }
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+public abstract class Byte extends AnyVal {
+
+ public final byte value;
+
+ public Byte (byte value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Byte && $eq$eq(((Byte )other).asByte ());
+ return other instanceof Byte && value == ((Byte )other).value;
}
public int hashCode() {
- int bits = asByte ();
+ int bits = value;
return bits;
}
public String toString() {
- return String.valueOf(asByte ());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,74 +34,89 @@ public abstract class Byte extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Int ; */
- public int $plus () { return +asInt () ; }
- /** @meta method []scala.Int ; */
- public int $minus () { return -asInt () ; }
- /** @meta method []scala.Int ; */
- public int $tilde () { return ~asInt () ; }
-
- public String $plus (String that) { return asInt () + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
-
- public float $plus (float that) { return asFloat () + that; }
- public float $minus (float that) { return asFloat () - that; }
- public float $times (float that) { return asFloat () * that; }
- public float $div (float that) { return asFloat () / that; }
- public float $percent (float that) { return asFloat () % that; }
- public boolean $eq$eq (float that) { return asFloat () == that; }
- public boolean $bang$eq (float that) { return asFloat () != that; }
- public boolean $less (float that) { return asFloat () < that; }
- public boolean $greater (float that) { return asFloat () > that; }
- public boolean $less$eq (float that) { return asFloat () <= that; }
- public boolean $greater$eq(float that) { return asFloat () >= that; }
-
- public int $less$less (int that) { return asInt () << that; }
- public int $less$less (long that) { return asInt () << that; }
- public int $greater$greater(int that) { return asInt () >> that; }
- public int $greater$greater(long that) { return asInt () >> that; }
- public int $greater$greater$greater(int that) { return asInt () >>>that; }
- public int $greater$greater$greater(long that) { return asInt () >>>that; }
-
- public long $amp (long that) { return asLong () & that; }
- public long $bar (long that) { return asLong () | that; }
- public long $up (long that) { return asLong () ^ that; }
- public long $plus (long that) { return asLong () + that; }
- public long $minus (long that) { return asLong () - that; }
- public long $times (long that) { return asLong () * that; }
- public long $div (long that) { return asLong () / that; }
- public long $percent (long that) { return asLong () % that; }
- public boolean $eq$eq (long that) { return asLong () == that; }
- public boolean $bang$eq (long that) { return asLong () != that; }
- public boolean $less (long that) { return asLong () < that; }
- public boolean $greater (long that) { return asLong () > that; }
- public boolean $less$eq (long that) { return asLong () <= that; }
- public boolean $greater$eq(long that) { return asLong () >= that; }
-
- public int $amp (int that) { return asInt () & that; }
- public int $bar (int that) { return asInt () | that; }
- public int $up (int that) { return asInt () ^ that; }
- public int $plus (int that) { return asInt () + that; }
- public int $minus (int that) { return asInt () - that; }
- public int $times (int that) { return asInt () * that; }
- public int $div (int that) { return asInt () / that; }
- public int $percent (int that) { return asInt () % that; }
- public boolean $eq$eq (int that) { return asInt () == that; }
- public boolean $bang$eq (int that) { return asInt () != that; }
- public boolean $less (int that) { return asInt () < that; }
- public boolean $greater (int that) { return asInt () > that; }
- public boolean $less$eq (int that) { return asInt () <= that; }
- public boolean $greater$eq(int that) { return asInt () >= that; }
+ /** @meta method []scala.Int ; */
+ public int $plus ( ) { return +value ; }
+ /** @meta method []scala.Int ; */
+ public int $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
+
+ /** @meta method []scala.Double ; */
+ public double coerce ( ) { return value ; }
+
+ public boolean $eq$eq (float that) { return value == that; }
+ public boolean $bang$eq (float that) { return value != that; }
+ public boolean $less (float that) { return value < that; }
+ public boolean $greater (float that) { return value > that; }
+ public boolean $less$eq (float that) { return value <= that; }
+ public boolean $greater$eq(float that) { return value >= that; }
+ public float $plus (float that) { return value + that; }
+ public float $minus (float that) { return value - that; }
+ public float $times (float that) { return value * that; }
+ public float $div (float that) { return value / that; }
+ public float $percent (float that) { return value % that; }
+
+ /** @meta method []scala.Float ; */
+ public float coerce ( ) { return value ; }
+ /** @meta method []scala.Int ; */
+ public int $tilde ( ) { return ~value ; }
+
+ public int $less$less (int that) { return value << that; }
+ public int $less$less (long that) { return value << that; }
+ public int $greater$greater(int that) { return value >> that; }
+ public int $greater$greater(long that) { return value >> that; }
+ public int $greater$greater$greater(int that) { return value >>>that; }
+ public int $greater$greater$greater(long that) { return value >>>that; }
+
+ public boolean $eq$eq (long that) { return value == that; }
+ public boolean $bang$eq (long that) { return value != that; }
+ public boolean $less (long that) { return value < that; }
+ public boolean $greater (long that) { return value > that; }
+ public boolean $less$eq (long that) { return value <= that; }
+ public boolean $greater$eq(long that) { return value >= that; }
+ public long $plus (long that) { return value + that; }
+ public long $minus (long that) { return value - that; }
+ public long $times (long that) { return value * that; }
+ public long $div (long that) { return value / that; }
+ public long $percent (long that) { return value % that; }
+ public long $bar (long that) { return value | that; }
+ public long $amp (long that) { return value & that; }
+ public long $up (long that) { return value ^ that; }
+
+ /** @meta method []scala.Long ; */
+ public long coerce ( ) { return value ; }
+
+ public boolean $eq$eq (int that) { return value == that; }
+ public boolean $bang$eq (int that) { return value != that; }
+ public boolean $less (int that) { return value < that; }
+ public boolean $greater (int that) { return value > that; }
+ public boolean $less$eq (int that) { return value <= that; }
+ public boolean $greater$eq(int that) { return value >= that; }
+ public int $plus (int that) { return value + that; }
+ public int $minus (int that) { return value - that; }
+ public int $times (int that) { return value * that; }
+ public int $div (int that) { return value / that; }
+ public int $percent (int that) { return value % that; }
+ public int $bar (int that) { return value | that; }
+ public int $amp (int that) { return value & that; }
+ public int $up (int that) { return value ^ that; }
+
+ /** @meta method []scala.Int ; */
+ public int coerce ( ) { return value ; }
+
+ /** @meta method []scala.Short ; */
+ public short coerce ( ) { return value ; }
}
diff --git a/sources/scala/Char.java b/sources/scala/Char.java
index f28be85f8e..863999909a 100644
--- a/sources/scala/Char.java
+++ b/sources/scala/Char.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Char extends AnyVal {
+public abstract class Char extends AnyVal {
+ public final char value;
-
- /** @meta method []scala.Int ; */
- public int coerce() { return asInt (); }
- /** @meta method []scala.Long ; */
- public long coerce() { return asLong (); }
- /** @meta method []scala.Float ; */
- public float coerce() { return asFloat (); }
- /** @meta method []scala.Double; */
- public double coerce() { return asDouble(); }
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+ public Char (char value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Char && $eq$eq(((Char )other).asChar ());
+ return other instanceof Char && value == ((Char )other).value;
}
public int hashCode() {
- int bits = asChar ();
+ int bits = value;
return bits;
}
public String toString() {
- return String.valueOf(asChar ());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,94 +34,106 @@ public abstract class Char extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Int ; */
- public int $plus () { return +asInt () ; }
- /** @meta method []scala.Int ; */
- public int $minus () { return -asInt () ; }
- /** @meta method []scala.Int ; */
- public int $tilde () { return ~asInt () ; }
-
- public String $plus (String that) { return asInt () + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
-
- public float $plus (float that) { return asFloat () + that; }
- public float $minus (float that) { return asFloat () - that; }
- public float $times (float that) { return asFloat () * that; }
- public float $div (float that) { return asFloat () / that; }
- public float $percent (float that) { return asFloat () % that; }
- public boolean $eq$eq (float that) { return asFloat () == that; }
- public boolean $bang$eq (float that) { return asFloat () != that; }
- public boolean $less (float that) { return asFloat () < that; }
- public boolean $greater (float that) { return asFloat () > that; }
- public boolean $less$eq (float that) { return asFloat () <= that; }
- public boolean $greater$eq(float that) { return asFloat () >= that; }
-
- public int $less$less (int that) { return asInt () << that; }
- public int $less$less (long that) { return asInt () << that; }
- public int $greater$greater(int that) { return asInt () >> that; }
- public int $greater$greater(long that) { return asInt () >> that; }
- public int $greater$greater$greater(int that) { return asInt () >>>that; }
- public int $greater$greater$greater(long that) { return asInt () >>>that; }
-
- public long $amp (long that) { return asLong () & that; }
- public long $bar (long that) { return asLong () | that; }
- public long $up (long that) { return asLong () ^ that; }
- public long $plus (long that) { return asLong () + that; }
- public long $minus (long that) { return asLong () - that; }
- public long $times (long that) { return asLong () * that; }
- public long $div (long that) { return asLong () / that; }
- public long $percent (long that) { return asLong () % that; }
- public boolean $eq$eq (long that) { return asLong () == that; }
- public boolean $bang$eq (long that) { return asLong () != that; }
- public boolean $less (long that) { return asLong () < that; }
- public boolean $greater (long that) { return asLong () > that; }
- public boolean $less$eq (long that) { return asLong () <= that; }
- public boolean $greater$eq(long that) { return asLong () >= that; }
-
- public int $amp (int that) { return asInt () & that; }
- public int $bar (int that) { return asInt () | that; }
- public int $up (int that) { return asInt () ^ that; }
- public int $plus (int that) { return asInt () + that; }
- public int $minus (int that) { return asInt () - that; }
- public int $times (int that) { return asInt () * that; }
- public int $div (int that) { return asInt () / that; }
- public int $percent (int that) { return asInt () % that; }
- public boolean $eq$eq (int that) { return asInt () == that; }
- public boolean $bang$eq (int that) { return asInt () != that; }
- public boolean $less (int that) { return asInt () < that; }
- public boolean $greater (int that) { return asInt () > that; }
- public boolean $less$eq (int that) { return asInt () <= that; }
- public boolean $greater$eq(int that) { return asInt () >= that; }
-
- /** @meta method scala.Boolean; */
+ /** @meta method []scala.Int ; */
+ public int $plus ( ) { return +value ; }
+ /** @meta method []scala.Int ; */
+ public int $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
+
+ /** @meta method []scala.Double ; */
+ public double coerce ( ) { return value ; }
+
+ public boolean $eq$eq (float that) { return value == that; }
+ public boolean $bang$eq (float that) { return value != that; }
+ public boolean $less (float that) { return value < that; }
+ public boolean $greater (float that) { return value > that; }
+ public boolean $less$eq (float that) { return value <= that; }
+ public boolean $greater$eq(float that) { return value >= that; }
+ public float $plus (float that) { return value + that; }
+ public float $minus (float that) { return value - that; }
+ public float $times (float that) { return value * that; }
+ public float $div (float that) { return value / that; }
+ public float $percent (float that) { return value % that; }
+
+ /** @meta method []scala.Float ; */
+ public float coerce ( ) { return value ; }
+ /** @meta method []scala.Int ; */
+ public int $tilde ( ) { return ~value ; }
+
+ public int $less$less (int that) { return value << that; }
+ public int $less$less (long that) { return value << that; }
+ public int $greater$greater(int that) { return value >> that; }
+ public int $greater$greater(long that) { return value >> that; }
+ public int $greater$greater$greater(int that) { return value >>>that; }
+ public int $greater$greater$greater(long that) { return value >>>that; }
+
+ public boolean $eq$eq (long that) { return value == that; }
+ public boolean $bang$eq (long that) { return value != that; }
+ public boolean $less (long that) { return value < that; }
+ public boolean $greater (long that) { return value > that; }
+ public boolean $less$eq (long that) { return value <= that; }
+ public boolean $greater$eq(long that) { return value >= that; }
+ public long $plus (long that) { return value + that; }
+ public long $minus (long that) { return value - that; }
+ public long $times (long that) { return value * that; }
+ public long $div (long that) { return value / that; }
+ public long $percent (long that) { return value % that; }
+ public long $bar (long that) { return value | that; }
+ public long $amp (long that) { return value & that; }
+ public long $up (long that) { return value ^ that; }
+
+ /** @meta method []scala.Long ; */
+ public long coerce ( ) { return value ; }
+
+ public boolean $eq$eq (int that) { return value == that; }
+ public boolean $bang$eq (int that) { return value != that; }
+ public boolean $less (int that) { return value < that; }
+ public boolean $greater (int that) { return value > that; }
+ public boolean $less$eq (int that) { return value <= that; }
+ public boolean $greater$eq(int that) { return value >= that; }
+ public int $plus (int that) { return value + that; }
+ public int $minus (int that) { return value - that; }
+ public int $times (int that) { return value * that; }
+ public int $div (int that) { return value / that; }
+ public int $percent (int that) { return value % that; }
+ public int $bar (int that) { return value | that; }
+ public int $amp (int that) { return value & that; }
+ public int $up (int that) { return value ^ that; }
+
+ /** @meta method []scala.Int ; */
+ public int coerce ( ) { return value ; }
+
+ /** @meta method []scala.Boolean; */
public boolean isDigit() {
- return Character.isDigit((char)asChar());
+ return Character.isDigit(value);
}
- /** @meta method scala.Boolean; */
+ /** @meta method []scala.Boolean; */
public boolean isLetter() {
- return Character.isLetter((char)asChar());
+ return Character.isLetter(value);
}
- /** @meta method scala.Boolean; */
+ /** @meta method []scala.Boolean; */
public boolean isLetterOrDigit() {
- return Character.isLetterOrDigit((char)asChar());
+ return Character.isLetterOrDigit(value);
}
- /** @meta method scala.Boolean; */
+ /** @meta method []scala.Boolean; */
public boolean isWhitespace() {
- return Character.isWhitespace((char)asChar());
+ return Character.isWhitespace(value);
}
}
diff --git a/sources/scala/Double.java b/sources/scala/Double.java
index 3a990e4970..372b51ad0b 100644
--- a/sources/scala/Double.java
+++ b/sources/scala/Double.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Double extends AnyVal {
+public abstract class Double extends AnyVal {
+ public final double value;
-
-
-
-
-
-
-
-
-
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+ public Double (double value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Double && $eq$eq(((Double)other).asDouble());
+ return other instanceof Double && value == ((Double )other).value;
}
public int hashCode() {
- long bits = java.lang.Double.doubleToLongBits(asDouble());
+ long bits = java.lang.Double.doubleToLongBits(value);
return (int)(bits ^ (bits >>> 32));
}
public String toString() {
- return String.valueOf(asDouble());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,25 +34,23 @@ public abstract class Double extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Double; */
- public double $plus () { return +asDouble() ; }
- /** @meta method []scala.Double; */
- public double $minus () { return -asDouble() ; }
-
-
-
- public String $plus (String that) { return asDouble() + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
+ /** @meta method []scala.Double ; */
+ public double $plus ( ) { return +value ; }
+ /** @meta method []scala.Double ; */
+ public double $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
}
diff --git a/sources/scala/Float.java b/sources/scala/Float.java
index fae1b06130..055d1a945c 100644
--- a/sources/scala/Float.java
+++ b/sources/scala/Float.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Float extends AnyVal {
+public abstract class Float extends AnyVal {
+ public final float value;
-
-
-
-
-
-
-
- /** @meta method []scala.Double; */
- public double coerce() { return asDouble(); }
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+ public Float (float value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Float && $eq$eq(((Float )other).asFloat ());
+ return other instanceof Float && value == ((Float )other).value;
}
public int hashCode() {
- int bits = java.lang.Float.floatToIntBits(asFloat());
+ int bits = java.lang.Float.floatToIntBits(value);
return bits;
}
public String toString() {
- return String.valueOf(asFloat ());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,37 +34,38 @@ public abstract class Float extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Float ; */
- public float $plus () { return +asFloat () ; }
- /** @meta method []scala.Float ; */
- public float $minus () { return -asFloat () ; }
-
-
-
- public String $plus (String that) { return asFloat () + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
-
- public float $plus (float that) { return asFloat () + that; }
- public float $minus (float that) { return asFloat () - that; }
- public float $times (float that) { return asFloat () * that; }
- public float $div (float that) { return asFloat () / that; }
- public float $percent (float that) { return asFloat () % that; }
- public boolean $eq$eq (float that) { return asFloat () == that; }
- public boolean $bang$eq (float that) { return asFloat () != that; }
- public boolean $less (float that) { return asFloat () < that; }
- public boolean $greater (float that) { return asFloat () > that; }
- public boolean $less$eq (float that) { return asFloat () <= that; }
- public boolean $greater$eq(float that) { return asFloat () >= that; }
+ /** @meta method []scala.Float ; */
+ public float $plus ( ) { return +value ; }
+ /** @meta method []scala.Float ; */
+ public float $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
+
+ /** @meta method []scala.Double ; */
+ public double coerce ( ) { return value ; }
+
+ public boolean $eq$eq (float that) { return value == that; }
+ public boolean $bang$eq (float that) { return value != that; }
+ public boolean $less (float that) { return value < that; }
+ public boolean $greater (float that) { return value > that; }
+ public boolean $less$eq (float that) { return value <= that; }
+ public boolean $greater$eq(float that) { return value >= that; }
+ public float $plus (float that) { return value + that; }
+ public float $minus (float that) { return value - that; }
+ public float $times (float that) { return value * that; }
+ public float $div (float that) { return value / that; }
+ public float $percent (float that) { return value % that; }
}
diff --git a/sources/scala/Int.java b/sources/scala/Int.java
index c77d818464..c8d9e098da 100644
--- a/sources/scala/Int.java
+++ b/sources/scala/Int.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Int extends AnyVal {
+public abstract class Int extends AnyVal {
+ public final int value;
-
-
-
- /** @meta method []scala.Long ; */
- public long coerce() { return asLong (); }
- /** @meta method []scala.Float ; */
- public float coerce() { return asFloat (); }
- /** @meta method []scala.Double; */
- public double coerce() { return asDouble(); }
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+ public Int (int value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Int && $eq$eq(((Int )other).asInt ());
+ return other instanceof Int && value == ((Int )other).value;
}
public int hashCode() {
- int bits = asInt ();
+ int bits = value;
return bits;
}
public String toString() {
- return String.valueOf(asInt ());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,74 +34,83 @@ public abstract class Int extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Int ; */
- public int $plus () { return +asInt () ; }
- /** @meta method []scala.Int ; */
- public int $minus () { return -asInt () ; }
- /** @meta method []scala.Int ; */
- public int $tilde () { return ~asInt () ; }
-
- public String $plus (String that) { return asInt () + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
-
- public float $plus (float that) { return asFloat () + that; }
- public float $minus (float that) { return asFloat () - that; }
- public float $times (float that) { return asFloat () * that; }
- public float $div (float that) { return asFloat () / that; }
- public float $percent (float that) { return asFloat () % that; }
- public boolean $eq$eq (float that) { return asFloat () == that; }
- public boolean $bang$eq (float that) { return asFloat () != that; }
- public boolean $less (float that) { return asFloat () < that; }
- public boolean $greater (float that) { return asFloat () > that; }
- public boolean $less$eq (float that) { return asFloat () <= that; }
- public boolean $greater$eq(float that) { return asFloat () >= that; }
-
- public int $less$less (int that) { return asInt () << that; }
- public int $less$less (long that) { return asInt () << that; }
- public int $greater$greater(int that) { return asInt () >> that; }
- public int $greater$greater(long that) { return asInt () >> that; }
- public int $greater$greater$greater(int that) { return asInt () >>>that; }
- public int $greater$greater$greater(long that) { return asInt () >>>that; }
-
- public long $amp (long that) { return asLong () & that; }
- public long $bar (long that) { return asLong () | that; }
- public long $up (long that) { return asLong () ^ that; }
- public long $plus (long that) { return asLong () + that; }
- public long $minus (long that) { return asLong () - that; }
- public long $times (long that) { return asLong () * that; }
- public long $div (long that) { return asLong () / that; }
- public long $percent (long that) { return asLong () % that; }
- public boolean $eq$eq (long that) { return asLong () == that; }
- public boolean $bang$eq (long that) { return asLong () != that; }
- public boolean $less (long that) { return asLong () < that; }
- public boolean $greater (long that) { return asLong () > that; }
- public boolean $less$eq (long that) { return asLong () <= that; }
- public boolean $greater$eq(long that) { return asLong () >= that; }
-
- public int $amp (int that) { return asInt () & that; }
- public int $bar (int that) { return asInt () | that; }
- public int $up (int that) { return asInt () ^ that; }
- public int $plus (int that) { return asInt () + that; }
- public int $minus (int that) { return asInt () - that; }
- public int $times (int that) { return asInt () * that; }
- public int $div (int that) { return asInt () / that; }
- public int $percent (int that) { return asInt () % that; }
- public boolean $eq$eq (int that) { return asInt () == that; }
- public boolean $bang$eq (int that) { return asInt () != that; }
- public boolean $less (int that) { return asInt () < that; }
- public boolean $greater (int that) { return asInt () > that; }
- public boolean $less$eq (int that) { return asInt () <= that; }
- public boolean $greater$eq(int that) { return asInt () >= that; }
+ /** @meta method []scala.Int ; */
+ public int $plus ( ) { return +value ; }
+ /** @meta method []scala.Int ; */
+ public int $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
+
+ /** @meta method []scala.Double ; */
+ public double coerce ( ) { return value ; }
+
+ public boolean $eq$eq (float that) { return value == that; }
+ public boolean $bang$eq (float that) { return value != that; }
+ public boolean $less (float that) { return value < that; }
+ public boolean $greater (float that) { return value > that; }
+ public boolean $less$eq (float that) { return value <= that; }
+ public boolean $greater$eq(float that) { return value >= that; }
+ public float $plus (float that) { return value + that; }
+ public float $minus (float that) { return value - that; }
+ public float $times (float that) { return value * that; }
+ public float $div (float that) { return value / that; }
+ public float $percent (float that) { return value % that; }
+
+ /** @meta method []scala.Float ; */
+ public float coerce ( ) { return value ; }
+ /** @meta method []scala.Int ; */
+ public int $tilde ( ) { return ~value ; }
+
+ public int $less$less (int that) { return value << that; }
+ public int $less$less (long that) { return value << that; }
+ public int $greater$greater(int that) { return value >> that; }
+ public int $greater$greater(long that) { return value >> that; }
+ public int $greater$greater$greater(int that) { return value >>>that; }
+ public int $greater$greater$greater(long that) { return value >>>that; }
+
+ public boolean $eq$eq (long that) { return value == that; }
+ public boolean $bang$eq (long that) { return value != that; }
+ public boolean $less (long that) { return value < that; }
+ public boolean $greater (long that) { return value > that; }
+ public boolean $less$eq (long that) { return value <= that; }
+ public boolean $greater$eq(long that) { return value >= that; }
+ public long $plus (long that) { return value + that; }
+ public long $minus (long that) { return value - that; }
+ public long $times (long that) { return value * that; }
+ public long $div (long that) { return value / that; }
+ public long $percent (long that) { return value % that; }
+ public long $bar (long that) { return value | that; }
+ public long $amp (long that) { return value & that; }
+ public long $up (long that) { return value ^ that; }
+
+ /** @meta method []scala.Long ; */
+ public long coerce ( ) { return value ; }
+
+ public boolean $eq$eq (int that) { return value == that; }
+ public boolean $bang$eq (int that) { return value != that; }
+ public boolean $less (int that) { return value < that; }
+ public boolean $greater (int that) { return value > that; }
+ public boolean $less$eq (int that) { return value <= that; }
+ public boolean $greater$eq(int that) { return value >= that; }
+ public int $plus (int that) { return value + that; }
+ public int $minus (int that) { return value - that; }
+ public int $times (int that) { return value * that; }
+ public int $div (int that) { return value / that; }
+ public int $percent (int that) { return value % that; }
+ public int $bar (int that) { return value | that; }
+ public int $amp (int that) { return value & that; }
+ public int $up (int that) { return value ^ that; }
}
diff --git a/sources/scala/Long.java b/sources/scala/Long.java
index a4ab6302a3..2cf7c0296c 100644
--- a/sources/scala/Long.java
+++ b/sources/scala/Long.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Long extends AnyVal {
+public abstract class Long extends AnyVal {
+ public final long value;
-
-
-
-
-
- /** @meta method []scala.Float ; */
- public float coerce() { return asFloat (); }
- /** @meta method []scala.Double; */
- public double coerce() { return asDouble(); }
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+ public Long (long value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Long && $eq$eq(((Long )other).asLong ());
+ return other instanceof Long && value == ((Long )other).value;
}
public int hashCode() {
- long bits = asLong ();
+ long bits = value;
return (int)(bits ^ (bits >>> 32));
}
public String toString() {
- return String.valueOf(asLong ());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,59 +34,65 @@ public abstract class Long extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Long ; */
- public long $plus () { return +asLong () ; }
- /** @meta method []scala.Long ; */
- public long $minus () { return -asLong () ; }
- /** @meta method []scala.Long ; */
- public long $tilde () { return ~asLong () ; }
-
- public String $plus (String that) { return asLong () + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
-
- public float $plus (float that) { return asFloat () + that; }
- public float $minus (float that) { return asFloat () - that; }
- public float $times (float that) { return asFloat () * that; }
- public float $div (float that) { return asFloat () / that; }
- public float $percent (float that) { return asFloat () % that; }
- public boolean $eq$eq (float that) { return asFloat () == that; }
- public boolean $bang$eq (float that) { return asFloat () != that; }
- public boolean $less (float that) { return asFloat () < that; }
- public boolean $greater (float that) { return asFloat () > that; }
- public boolean $less$eq (float that) { return asFloat () <= that; }
- public boolean $greater$eq(float that) { return asFloat () >= that; }
-
- public long $less$less (int that) { return asLong () << that; }
- public long $less$less (long that) { return asLong () << that; }
- public long $greater$greater(int that) { return asLong () >> that; }
- public long $greater$greater(long that) { return asLong () >> that; }
- public long $greater$greater$greater(int that) { return asLong () >>>that; }
- public long $greater$greater$greater(long that) { return asLong () >>>that; }
-
- public long $amp (long that) { return asLong () & that; }
- public long $bar (long that) { return asLong () | that; }
- public long $up (long that) { return asLong () ^ that; }
- public long $plus (long that) { return asLong () + that; }
- public long $minus (long that) { return asLong () - that; }
- public long $times (long that) { return asLong () * that; }
- public long $div (long that) { return asLong () / that; }
- public long $percent (long that) { return asLong () % that; }
- public boolean $eq$eq (long that) { return asLong () == that; }
- public boolean $bang$eq (long that) { return asLong () != that; }
- public boolean $less (long that) { return asLong () < that; }
- public boolean $greater (long that) { return asLong () > that; }
- public boolean $less$eq (long that) { return asLong () <= that; }
- public boolean $greater$eq(long that) { return asLong () >= that; }
+ /** @meta method []scala.Long ; */
+ public long $plus ( ) { return +value ; }
+ /** @meta method []scala.Long ; */
+ public long $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
+
+ /** @meta method []scala.Double ; */
+ public double coerce ( ) { return value ; }
+
+ public boolean $eq$eq (float that) { return value == that; }
+ public boolean $bang$eq (float that) { return value != that; }
+ public boolean $less (float that) { return value < that; }
+ public boolean $greater (float that) { return value > that; }
+ public boolean $less$eq (float that) { return value <= that; }
+ public boolean $greater$eq(float that) { return value >= that; }
+ public float $plus (float that) { return value + that; }
+ public float $minus (float that) { return value - that; }
+ public float $times (float that) { return value * that; }
+ public float $div (float that) { return value / that; }
+ public float $percent (float that) { return value % that; }
+
+ /** @meta method []scala.Float ; */
+ public float coerce ( ) { return value ; }
+ /** @meta method []scala.Long ; */
+ public long $tilde ( ) { return ~value ; }
+
+ public long $less$less (int that) { return value << that; }
+ public long $less$less (long that) { return value << that; }
+ public long $greater$greater(int that) { return value >> that; }
+ public long $greater$greater(long that) { return value >> that; }
+ public long $greater$greater$greater(int that) { return value >>>that; }
+ public long $greater$greater$greater(long that) { return value >>>that; }
+
+ public boolean $eq$eq (long that) { return value == that; }
+ public boolean $bang$eq (long that) { return value != that; }
+ public boolean $less (long that) { return value < that; }
+ public boolean $greater (long that) { return value > that; }
+ public boolean $less$eq (long that) { return value <= that; }
+ public boolean $greater$eq(long that) { return value >= that; }
+ public long $plus (long that) { return value + that; }
+ public long $minus (long that) { return value - that; }
+ public long $times (long that) { return value * that; }
+ public long $div (long that) { return value / that; }
+ public long $percent (long that) { return value % that; }
+ public long $bar (long that) { return value | that; }
+ public long $amp (long that) { return value & that; }
+ public long $up (long that) { return value ^ that; }
}
diff --git a/sources/scala/Short.java b/sources/scala/Short.java
index 4f69ddbaa5..fed2aa38d8 100644
--- a/sources/scala/Short.java
+++ b/sources/scala/Short.java
@@ -10,36 +10,23 @@
package scala;
-public abstract class Short extends AnyVal {
+public abstract class Short extends AnyVal {
+ public final short value;
-
- /** @meta method []scala.Int ; */
- public int coerce() { return asInt (); }
- /** @meta method []scala.Long ; */
- public long coerce() { return asLong (); }
- /** @meta method []scala.Float ; */
- public float coerce() { return asFloat (); }
- /** @meta method []scala.Double; */
- public double coerce() { return asDouble(); }
-
- public abstract double asDouble();
- public abstract float asFloat();
- public abstract long asLong();
- public abstract int asInt();
- public abstract char asChar();
- public abstract short asShort();
- public abstract byte asByte();
+ public Short (short value) {
+ this.value = value;
+ }
public boolean equals(java.lang.Object other) {
- return other instanceof Short && $eq$eq(((Short )other).asShort ());
+ return other instanceof Short && value == ((Short )other).value;
}
public int hashCode() {
- int bits = asShort ();
+ int bits = value;
return bits;
}
public String toString() {
- return String.valueOf(asShort ());
+ return String.valueOf(value);
}
/** @meta method (scala.Any)scala.Boolean; */
@@ -47,74 +34,86 @@ public abstract class Short extends AnyVal {
/** @meta method (scala.Any)scala.Boolean; */
public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method []scala.Int ; */
- public int $plus () { return +asInt () ; }
- /** @meta method []scala.Int ; */
- public int $minus () { return -asInt () ; }
- /** @meta method []scala.Int ; */
- public int $tilde () { return ~asInt () ; }
-
- public String $plus (String that) { return asInt () + that; }
-
- public double $plus (double that) { return asDouble() + that; }
- public double $minus (double that) { return asDouble() - that; }
- public double $times (double that) { return asDouble() * that; }
- public double $div (double that) { return asDouble() / that; }
- public double $percent (double that) { return asDouble() % that; }
- public boolean $eq$eq (double that) { return asDouble() == that; }
- public boolean $bang$eq (double that) { return asDouble() != that; }
- public boolean $less (double that) { return asDouble() < that; }
- public boolean $greater (double that) { return asDouble() > that; }
- public boolean $less$eq (double that) { return asDouble() <= that; }
- public boolean $greater$eq(double that) { return asDouble() >= that; }
-
- public float $plus (float that) { return asFloat () + that; }
- public float $minus (float that) { return asFloat () - that; }
- public float $times (float that) { return asFloat () * that; }
- public float $div (float that) { return asFloat () / that; }
- public float $percent (float that) { return asFloat () % that; }
- public boolean $eq$eq (float that) { return asFloat () == that; }
- public boolean $bang$eq (float that) { return asFloat () != that; }
- public boolean $less (float that) { return asFloat () < that; }
- public boolean $greater (float that) { return asFloat () > that; }
- public boolean $less$eq (float that) { return asFloat () <= that; }
- public boolean $greater$eq(float that) { return asFloat () >= that; }
-
- public int $less$less (int that) { return asInt () << that; }
- public int $less$less (long that) { return asInt () << that; }
- public int $greater$greater(int that) { return asInt () >> that; }
- public int $greater$greater(long that) { return asInt () >> that; }
- public int $greater$greater$greater(int that) { return asInt () >>>that; }
- public int $greater$greater$greater(long that) { return asInt () >>>that; }
-
- public long $amp (long that) { return asLong () & that; }
- public long $bar (long that) { return asLong () | that; }
- public long $up (long that) { return asLong () ^ that; }
- public long $plus (long that) { return asLong () + that; }
- public long $minus (long that) { return asLong () - that; }
- public long $times (long that) { return asLong () * that; }
- public long $div (long that) { return asLong () / that; }
- public long $percent (long that) { return asLong () % that; }
- public boolean $eq$eq (long that) { return asLong () == that; }
- public boolean $bang$eq (long that) { return asLong () != that; }
- public boolean $less (long that) { return asLong () < that; }
- public boolean $greater (long that) { return asLong () > that; }
- public boolean $less$eq (long that) { return asLong () <= that; }
- public boolean $greater$eq(long that) { return asLong () >= that; }
-
- public int $amp (int that) { return asInt () & that; }
- public int $bar (int that) { return asInt () | that; }
- public int $up (int that) { return asInt () ^ that; }
- public int $plus (int that) { return asInt () + that; }
- public int $minus (int that) { return asInt () - that; }
- public int $times (int that) { return asInt () * that; }
- public int $div (int that) { return asInt () / that; }
- public int $percent (int that) { return asInt () % that; }
- public boolean $eq$eq (int that) { return asInt () == that; }
- public boolean $bang$eq (int that) { return asInt () != that; }
- public boolean $less (int that) { return asInt () < that; }
- public boolean $greater (int that) { return asInt () > that; }
- public boolean $less$eq (int that) { return asInt () <= that; }
- public boolean $greater$eq(int that) { return asInt () >= that; }
+ /** @meta method []scala.Int ; */
+ public int $plus ( ) { return +value ; }
+ /** @meta method []scala.Int ; */
+ public int $minus ( ) { return -value ; }
+
+ public String $plus (String that) { return value + that; }
+
+ public boolean $eq$eq (double that) { return value == that; }
+ public boolean $bang$eq (double that) { return value != that; }
+ public boolean $less (double that) { return value < that; }
+ public boolean $greater (double that) { return value > that; }
+ public boolean $less$eq (double that) { return value <= that; }
+ public boolean $greater$eq(double that) { return value >= that; }
+ public double $plus (double that) { return value + that; }
+ public double $minus (double that) { return value - that; }
+ public double $times (double that) { return value * that; }
+ public double $div (double that) { return value / that; }
+ public double $percent (double that) { return value % that; }
+
+ /** @meta method []scala.Double ; */
+ public double coerce ( ) { return value ; }
+
+ public boolean $eq$eq (float that) { return value == that; }
+ public boolean $bang$eq (float that) { return value != that; }
+ public boolean $less (float that) { return value < that; }
+ public boolean $greater (float that) { return value > that; }
+ public boolean $less$eq (float that) { return value <= that; }
+ public boolean $greater$eq(float that) { return value >= that; }
+ public float $plus (float that) { return value + that; }
+ public float $minus (float that) { return value - that; }
+ public float $times (float that) { return value * that; }
+ public float $div (float that) { return value / that; }
+ public float $percent (float that) { return value % that; }
+
+ /** @meta method []scala.Float ; */
+ public float coerce ( ) { return value ; }
+ /** @meta method []scala.Int ; */
+ public int $tilde ( ) { return ~value ; }
+
+ public int $less$less (int that) { return value << that; }
+ public int $less$less (long that) { return value << that; }
+ public int $greater$greater(int that) { return value >> that; }
+ public int $greater$greater(long that) { return value >> that; }
+ public int $greater$greater$greater(int that) { return value >>>that; }
+ public int $greater$greater$greater(long that) { return value >>>that; }
+
+ public boolean $eq$eq (long that) { return value == that; }
+ public boolean $bang$eq (long that) { return value != that; }
+ public boolean $less (long that) { return value < that; }
+ public boolean $greater (long that) { return value > that; }
+ public boolean $less$eq (long that) { return value <= that; }
+ public boolean $greater$eq(long that) { return value >= that; }
+ public long $plus (long that) { return value + that; }
+ public long $minus (long that) { return value - that; }
+ public long $times (long that) { return value * that; }
+ public long $div (long that) { return value / that; }
+ public long $percent (long that) { return value % that; }
+ public long $bar (long that) { return value | that; }
+ public long $amp (long that) { return value & that; }
+ public long $up (long that) { return value ^ that; }
+
+ /** @meta method []scala.Long ; */
+ public long coerce ( ) { return value ; }
+
+ public boolean $eq$eq (int that) { return value == that; }
+ public boolean $bang$eq (int that) { return value != that; }
+ public boolean $less (int that) { return value < that; }
+ public boolean $greater (int that) { return value > that; }
+ public boolean $less$eq (int that) { return value <= that; }
+ public boolean $greater$eq(int that) { return value >= that; }
+ public int $plus (int that) { return value + that; }
+ public int $minus (int that) { return value - that; }
+ public int $times (int that) { return value * that; }
+ public int $div (int that) { return value / that; }
+ public int $percent (int that) { return value % that; }
+ public int $bar (int that) { return value | that; }
+ public int $amp (int that) { return value & that; }
+ public int $up (int that) { return value ^ that; }
+
+ /** @meta method []scala.Int ; */
+ public int coerce ( ) { return value ; }
}
diff --git a/sources/scala/Unit.java b/sources/scala/Unit.java
index af81ff3585..dd50889c10 100644
--- a/sources/scala/Unit.java
+++ b/sources/scala/Unit.java
@@ -10,31 +10,28 @@
package scala;
-/**
- * Scala's Unit class.
- */
+public abstract class Unit extends AnyVal {
-public abstract class Unit extends AnyVal {
- public void asUnit() {
- }
+ public final void value() {}
+
+ public Unit ( ) {
- public boolean equals(java.lang.Object obj) {
- return obj instanceof Unit;
}
+ public boolean equals(java.lang.Object other) {
+ return other instanceof Unit;
+ }
public int hashCode() {
- return 4041;
+ int bits = 4041;
+ return bits;
}
-
public String toString() {
return "()";
}
- /** @meta method (scala.Any)scala.Boolean;
- */
- public boolean $eq$eq(java.lang.Object obj) { return equals(obj); }
+ /** @meta method (scala.Any)scala.Boolean; */
+ public boolean $eq$eq (java.lang.Object other) { return equals(other); }
+ /** @meta method (scala.Any)scala.Boolean; */
+ public boolean $bang$eq(java.lang.Object other) { return !equals(other); }
- /** @meta method (scala.Any)scala.Boolean;
- */
- public boolean $bang$eq(java.lang.Object obj) { return !equals(obj); }
}
diff --git a/sources/scala/runtime/NativeLoop.java b/sources/scala/runtime/NativeLoop.java
index b849bd222d..a45cc9f202 100644
--- a/sources/scala/runtime/NativeLoop.java
+++ b/sources/scala/runtime/NativeLoop.java
@@ -15,7 +15,7 @@ public class NativeLoop {
/** @meta method [?A] (def scala.Boolean, def ?A) scala.Unit;
*/
public static void loopWhile(scala.Function0 cond, scala.Function0 body) {
- while (((scala.Boolean)cond.apply()).asBoolean()) {
+ while (((scala.Boolean)cond.apply()).value) {
body.apply();
}
}
diff --git a/sources/scala/runtime/RunTime.java b/sources/scala/runtime/RunTime.java
index d1c004fd7d..d32a1fed8a 100644
--- a/sources/scala/runtime/RunTime.java
+++ b/sources/scala/runtime/RunTime.java
@@ -27,10 +27,10 @@ public abstract class RunTime {
//########################################################################
// Private Constants
- private static final int BITS = 8;
- private static final int ARRAY_SIZE = 2 << BITS;
- private static final int INDEX_MASK = ARRAY_SIZE - 1;
- private static final int CHECK_MASK = ~(ARRAY_SIZE / 2 - 1);
+ private static final int BITS = 8;
+ private static final int ARRAY_SIZE = 2 << BITS;
+ private static final int INDEX_MASK = ARRAY_SIZE - 1;
+ private static final int CHECK_MASK = ~(ARRAY_SIZE / 2 - 1);
private static final UValue uvalue = new UValue();
private static final ZValue zvalue_f = new ZValue(false);
@@ -181,15 +181,15 @@ public abstract class RunTime {
//########################################################################
// Public Functions - Unboxing primitives
- public static void unbox_uvalue(Unit x) { x.asUnit (); }
- public static boolean unbox_zvalue(Boolean x) { return x.asBoolean(); }
- public static byte unbox_bvalue(Byte x) { return x.asByte (); }
- public static short unbox_svalue(Short x) { return x.asShort (); }
- public static char unbox_cvalue(Char x) { return x.asChar (); }
- public static int unbox_ivalue(Int x) { return x.asInt (); }
- public static long unbox_lvalue(Long x) { return x.asLong (); }
- public static float unbox_fvalue(Float x) { return x.asFloat (); }
- public static double unbox_dvalue(Double x) { return x.asDouble (); }
+ public static void unbox_uvalue(Unit x) { x.value(); }
+ public static boolean unbox_zvalue(Boolean x) { return x.value ; }
+ public static byte unbox_bvalue(Byte x) { return x.value ; }
+ public static short unbox_svalue(Short x) { return x.value ; }
+ public static char unbox_cvalue(Char x) { return x.value ; }
+ public static int unbox_ivalue(Int x) { return x.value ; }
+ public static long unbox_lvalue(Long x) { return x.value ; }
+ public static float unbox_fvalue(Float x) { return x.value ; }
+ public static double unbox_dvalue(Double x) { return x.value ; }
/** @meta method (scala.Array[scala.Boolean]) scala.Array[scala.Boolean];*/
public static boolean[] unbox_zarray(Array xs) {
@@ -342,98 +342,15 @@ public abstract class RunTime {
// classes confuse pico which then attributes the metadata to the
// wrong members.
-class UValue extends Unit {
-}
-
-class ZValue extends Boolean {
- private final boolean x;
- public ZValue(boolean x) { this.x = x; }
- public boolean asBoolean() { return x; }
-}
-
-class BValue extends Byte {
- private final byte x;
- public BValue(byte x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
-
-class SValue extends Short {
- private final short x;
- public SValue(short x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
-
-class CValue extends Char {
- private final char x;
- public CValue(char x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
-
-class IValue extends Int {
- private final int x;
- public IValue(int x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
-
-class LValue extends Long {
- private final long x;
- public LValue(long x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
-
-class FValue extends Float {
- private final float x;
- public FValue(float x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
-
-class DValue extends Double {
- private final double x;
- public DValue(double x) { this.x = x; }
- public double asDouble() { return (double)x; }
- public float asFloat() { return (float)x; }
- public long asLong() { return (long)x; }
- public int asInt() { return (int)x; }
- public char asChar() { return (char)x; }
- public short asShort() { return (short)x; }
- public byte asByte() { return (byte)x; }
-}
+class UValue extends Unit { public UValue( ) { super( ); } }
+class ZValue extends Boolean { public ZValue(boolean x) { super(x); } }
+class BValue extends Byte { public BValue(byte x) { super(x); } }
+class SValue extends Short { public SValue(short x) { super(x); } }
+class CValue extends Char { public CValue(char x) { super(x); } }
+class IValue extends Int { public IValue(int x) { super(x); } }
+class LValue extends Long { public LValue(long x) { super(x); } }
+class FValue extends Float { public FValue(float x) { super(x); } }
+class DValue extends Double { public DValue(double x) { super(x); } }
class ZArray extends Array {
private final boolean[] xs;
@@ -441,7 +358,7 @@ class ZArray extends Array {
public boolean[] asBooleanArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_zvalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Boolean)x).asBoolean(); }
+ public void update(int i, Object x) { xs[i] = ((Boolean)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
@@ -452,7 +369,7 @@ class BArray extends Array {
public byte[] asByteArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_bvalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Byte)x).asByte(); }
+ public void update(int i, Object x) { xs[i] = ((Byte)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
@@ -463,7 +380,7 @@ class SArray extends Array {
public short[] asShortArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_svalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Short)x).asShort(); }
+ public void update(int i, Object x) { xs[i] = ((Short)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
@@ -474,7 +391,7 @@ class CArray extends Array {
public char[] asCharArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_cvalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Char)x).asChar(); }
+ public void update(int i, Object x) { xs[i] = ((Char)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf((Object)xs); }
}
@@ -485,7 +402,7 @@ class IArray extends Array {
public int[] asIntArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_ivalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Int)x).asInt(); }
+ public void update(int i, Object x) { xs[i] = ((Int)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
@@ -496,7 +413,7 @@ class LArray extends Array {
public long[] asLongArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_lvalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Long)x).asLong(); }
+ public void update(int i, Object x) { xs[i] = ((Long)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
@@ -507,7 +424,7 @@ class FArray extends Array {
public float[] asFloatArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_fvalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Float)x).asFloat(); }
+ public void update(int i, Object x) { xs[i] = ((Float)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
@@ -518,7 +435,7 @@ class DArray extends Array {
public double[] asDoubleArray() { return xs; }
public Object asArray() { return xs; }
public Object apply(int i) { return RunTime.box_dvalue(xs[i]); }
- public void update(int i, Object x) { xs[i] = ((Double)x).asDouble(); }
+ public void update(int i, Object x) { xs[i] = ((Double)x).value; }
public int length() { return xs.length; }
public String toString() { return String.valueOf(xs); }
}
diff --git a/sources/scala/tools/scalai/Evaluator.java b/sources/scala/tools/scalai/Evaluator.java
index 9003ea47d9..30c27053a6 100644
--- a/sources/scala/tools/scalai/Evaluator.java
+++ b/sources/scala/tools/scalai/Evaluator.java
@@ -201,14 +201,14 @@ public class Evaluator {
case Or(Code lf, Code rg):
Object object = evaluate(lf);
assert object instanceof scala.Boolean : object.getClass();
- boolean value = ((scala.Boolean)object).asBoolean();
+ boolean value = ((scala.Boolean)object).value;
if (value) return new Boolean(value);
return evaluate(rg);
case And(Code lf, Code rg):
Object object = evaluate(lf);
assert object instanceof scala.Boolean : object.getClass();
- boolean value = ((scala.Boolean)object).asBoolean();
+ boolean value = ((scala.Boolean)object).value;
if (!value) return new Boolean(value);
return evaluate(rg);
@@ -246,31 +246,31 @@ public class Evaluator {
case Pos:
if (object instanceof scala.Int) {
- int value = ((scala.Int)object).asInt();
+ int value = ((scala.Int)object).value;
return new Integer(value);
} else if (object instanceof scala.Long) {
- long value = ((scala.Long)object).asLong();
+ long value = ((scala.Long)object).value;
return new Long(value);
} else if (object instanceof scala.Float) {
- float value = ((scala.Float)object).asFloat();
+ float value = ((scala.Float)object).value;
return new Float(value);
} else {
- double value = ((scala.Double)object).asDouble();
+ double value = ((scala.Double)object).value;
return new Double(value);
}
case Neg:
if (object instanceof scala.Int) {
- int value = ((scala.Int)object).asInt();
+ int value = ((scala.Int)object).value;
return new Integer(-value);
} else if (object instanceof scala.Long) {
- long value = ((scala.Long)object).asLong();
+ long value = ((scala.Long)object).value;
return new Long(-value);
} else if (object instanceof scala.Float) {
- float value = ((scala.Float)object).asFloat();
+ float value = ((scala.Float)object).value;
return new Float(-value);
} else {
- double value = ((scala.Double)object).asDouble();
+ double value = ((scala.Double)object).value;
return new Double(-value);
}