diff options
author | schinz <schinz@epfl.ch> | 2003-02-17 12:53:19 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2003-02-17 12:53:19 +0000 |
commit | 48e7aa8296f555f1521255fd6fe0d3aa6b834c2a (patch) | |
tree | 0a9953e0b143e3784ae17c9c7acfec1748338c5a | |
parent | 672f97063137767359641f9bc1fb3c49315add3b (diff) | |
download | scala-48e7aa8296f555f1521255fd6fe0d3aa6b834c2a.tar.gz scala-48e7aa8296f555f1521255fd6fe0d3aa6b834c2a.tar.bz2 scala-48e7aa8296f555f1521255fd6fe0d3aa6b834c2a.zip |
- imported from old repository
-rw-r--r-- | sources/scala/AnyVal.java | 21 | ||||
-rw-r--r-- | sources/scala/Array.java | 76 | ||||
-rw-r--r-- | sources/scala/Boolean.java | 68 | ||||
-rw-r--r-- | sources/scala/Byte.java | 21 | ||||
-rw-r--r-- | sources/scala/Char.java | 40 | ||||
-rw-r--r-- | sources/scala/Double.java | 65 | ||||
-rw-r--r-- | sources/scala/Float.java | 55 | ||||
-rw-r--r-- | sources/scala/Int.java | 100 | ||||
-rw-r--r-- | sources/scala/Long.java | 77 | ||||
-rw-r--r-- | sources/scala/Object.java | 23 | ||||
-rw-r--r-- | sources/scala/Short.java | 21 | ||||
-rw-r--r-- | sources/scala/Unit.java | 32 |
12 files changed, 599 insertions, 0 deletions
diff --git a/sources/scala/AnyVal.java b/sources/scala/AnyVal.java new file mode 100644 index 0000000000..32132a8337 --- /dev/null +++ b/sources/scala/AnyVal.java @@ -0,0 +1,21 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: AnyVal.java,v 1.4 2002/11/13 15:24:42 schinz Exp $ +// $Id$ + +package scala; + +/** @meta class extends scala.Any; + */ +public abstract class AnyVal { + /** @meta constr(); + */ + public AnyVal() { + } +} diff --git a/sources/scala/Array.java b/sources/scala/Array.java new file mode 100644 index 0000000000..125b6f6290 --- /dev/null +++ b/sources/scala/Array.java @@ -0,0 +1,76 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Array.java,v 1.9 2002/03/18 16:55:10 zenger Exp $ +// $Id$ + +package scala; + +/** @meta class [?T] extends scala.Function1[scala.Int, ?T]; + */ +public abstract class Array implements Function1 { + + /** @meta constr (scala.Int); + */ + public Array(int n) { + } + + public boolean[] asBooleanArray() { + throw new ClassCastException(); + } + + public byte[] asByteArray() { + throw new ClassCastException(); + } + + public short[] asShortArray() { + throw new ClassCastException(); + } + + public char[] asCharArray() { + throw new ClassCastException(); + } + + public int[] asIntArray() { + throw new ClassCastException(); + } + + public long[] asLongArray() { + throw new ClassCastException(); + } + + public float[] asFloatArray() { + throw new ClassCastException(); + } + + public double[] asDoubleArray() { + throw new ClassCastException(); + } + + /** @meta method () scala.Array[scala.Any]; + */ + public java.lang.Object[] asObjectArray() { + throw new ClassCastException(); + } + + public java.lang.Object apply(java.lang.Object i) { + return apply(((Number) i).intValue()); + } + + /** @meta method (scala.Int) ?T; + */ + public abstract java.lang.Object apply(int i); + + /** @meta method (scala.Int, ?T) scala.Unit; + */ + public abstract void update(int i, java.lang.Object x); + + /** @meta method []scala.Int; + */ + public abstract int length(); +} diff --git a/sources/scala/Boolean.java b/sources/scala/Boolean.java new file mode 100644 index 0000000000..68dc3bb498 --- /dev/null +++ b/sources/scala/Boolean.java @@ -0,0 +1,68 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $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 static final boolean True = true; + public static final boolean False = false; + + public abstract boolean asBoolean(); + + public boolean $amp$amp(boolean that) { + return asBoolean() && that; + } + + public boolean $bar$bar(boolean that) { + return asBoolean() || that; + } + + public boolean $amp(boolean that) { + return asBoolean() & that; + } + + public boolean $bar(boolean that) { + return asBoolean() | that; + } + + public boolean $up(boolean that) { + return asBoolean() ^ that; + } + + /** @meta method []scala.Boolean; + */ + public boolean $bang() { + return !asBoolean(); + } + + public boolean $eq$eq(boolean that) { + return asBoolean() == that; + } + + 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()); + } +} diff --git a/sources/scala/Byte.java b/sources/scala/Byte.java new file mode 100644 index 0000000000..965d52f9d3 --- /dev/null +++ b/sources/scala/Byte.java @@ -0,0 +1,21 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Byte.java,v 1.9 2002/04/15 16:21:39 paltherr Exp $ +// $Id$ + +package scala; + + +public abstract class Byte extends Short { + public String toString() { return String.valueOf(asByte()); } + public int hashCode() { return asInt(); } + public boolean equals(java.lang.Object obj) { + return obj instanceof Byte && $eq$eq(((Byte)obj).asByte()); + } +} diff --git a/sources/scala/Char.java b/sources/scala/Char.java new file mode 100644 index 0000000000..aa03382a4c --- /dev/null +++ b/sources/scala/Char.java @@ -0,0 +1,40 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Char.java,v 1.11 2002/05/15 15:03:38 roeckl Exp $ +// $Id$ + +package scala; + + +public abstract class Char extends Int { + + public String toString() { return String.valueOf((char)asInt()); } + + public int hashCode() { return asInt(); } + + /** @meta method scala.Boolean; + */ + public boolean isDigit() { return Character.isDigit((char)asInt()); } + + /** @meta method scala.Boolean; + */ + public boolean isLetter() { return Character.isLetter((char)asInt()); } + + /** @meta method scala.Boolean; + */ + public boolean isLetterOrDigit() { return Character.isLetterOrDigit((char)asInt()); } + + /** @meta method scala.Boolean; + */ + public boolean isWhitespace() { return Character.isWhitespace((char)asInt()); } + + public boolean equals(java.lang.Object obj) { + return obj instanceof Char && $eq$eq(((Char)obj).asChar()); + } +} diff --git a/sources/scala/Double.java b/sources/scala/Double.java new file mode 100644 index 0000000000..8531ac55d6 --- /dev/null +++ b/sources/scala/Double.java @@ -0,0 +1,65 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Double.java,v 1.13 2002/10/11 08:17:20 schinz Exp $ +// $Id$ + +package scala; + + +public abstract class Double extends AnyVal { + 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(); + + // The following definitions are *default* definitions for the + // "is" methods, and *not* the correct definitions for the + // "Double" class. The correct definitions for the real "Double" + // class are to be found in "RunTime.java". + public boolean isDouble() { return true; } + public boolean isFloat() { return true; } + public boolean isLong() { return true; } + public boolean isInt() { return true; } + public boolean isChar() { return true; } + public boolean isShort() { return true; } + public boolean isByte() { return true; } + + /** @meta method []scala.Double; + */ + public double $plus() { return asDouble(); } + /** @meta method []scala.Double; + */ + public double $minus() { return -asDouble(); } + + 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 String toString() { return String.valueOf(asDouble()); } + public String $plus(String that) { return this + that; } + public int hashCode() { + long bits = java.lang.Double.doubleToLongBits(asDouble()); + return (int)(bits ^ (bits >>> 32)); + } + public boolean equals(java.lang.Object obj) { + return obj instanceof Double && $eq$eq(((Double)obj).asDouble()); + } +} diff --git a/sources/scala/Float.java b/sources/scala/Float.java new file mode 100644 index 0000000000..3d3567f25e --- /dev/null +++ b/sources/scala/Float.java @@ -0,0 +1,55 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Float.java,v 1.13 2002/09/19 10:36:39 paltherr Exp $ +// $Id$ + +package scala; + + +public abstract class Float extends Double { + /** @meta method []scala.Float; + */ + public float $plus() { return asFloat(); } + /** @meta method []scala.Float; + */ + public float $minus() { return -asFloat(); } + + 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 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 String toString() { return String.valueOf(asFloat()); } + public String $plus(String that) { return this + that; } + public int hashCode() { return java.lang.Float.floatToIntBits(asFloat()); } + public boolean equals(java.lang.Object obj) { + return obj instanceof Float && $eq$eq(((Float)obj).asFloat()); + } +} diff --git a/sources/scala/Int.java b/sources/scala/Int.java new file mode 100644 index 0000000000..ac05f5dcc1 --- /dev/null +++ b/sources/scala/Int.java @@ -0,0 +1,100 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Int.java,v 1.16 2002/09/19 10:36:39 paltherr Exp $ +// $Id$ + +package scala; + +public abstract class Int extends Long { + /** @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 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 int $less$less(int that) { return asInt() << that; } + public int $greater$greater(int that) { return asInt() >> that; } + public int $greater$greater$greater(int that) { return asInt() >>> 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 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; } + + 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 long $less$less(long that) { return asLong() << that; } + public long $greater$greater(long 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 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 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 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 String $plus(String that) { return this + that; } + + public String toString() { return String.valueOf(asInt()); } + + public int hashCode() { return asInt(); } + + public boolean equals(java.lang.Object obj) { + return obj instanceof Int && $eq$eq(((Int)obj).asInt()); + } +} diff --git a/sources/scala/Long.java b/sources/scala/Long.java new file mode 100644 index 0000000000..a23ec04322 --- /dev/null +++ b/sources/scala/Long.java @@ -0,0 +1,77 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Long.java,v 1.14 2002/09/19 10:36:39 paltherr Exp $ +// $Id$ + +package scala; + +public abstract class Long extends Float { + /** @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 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 long $less$less(long that) { return asLong() << that; } + public long $greater$greater(long 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 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 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 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 String toString() { return String.valueOf(asLong()); } + public String $plus(String that) { return this + that; } + public int hashCode() { return (int)(asLong() ^ (asLong() >>> 32)); } + public boolean equals(java.lang.Object obj) { + return obj instanceof Long && $eq$eq(((Long)obj).asLong()); + } +} diff --git a/sources/scala/Object.java b/sources/scala/Object.java new file mode 100644 index 0000000000..694bf3d319 --- /dev/null +++ b/sources/scala/Object.java @@ -0,0 +1,23 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Object.java,v 1.7 2002/03/12 13:32:46 zenger Exp $ +// $Id$ + +package scala; + + +/** @meta class extends scala.AnyRef; + */ +public interface Object { +} + +/** @meta class extends scala.AnyRef; + */ +public class Object$class implements Object { +} diff --git a/sources/scala/Short.java b/sources/scala/Short.java new file mode 100644 index 0000000000..453b2adf59 --- /dev/null +++ b/sources/scala/Short.java @@ -0,0 +1,21 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $OldId: Short.java,v 1.9 2002/04/15 16:21:39 paltherr Exp $ +// $Id$ + +package scala; + + +public abstract class Short extends Int { + public String toString() { return String.valueOf(asShort()); } + public int hashCode() { return asInt(); } + public boolean equals(java.lang.Object obj) { + return obj instanceof Short && $eq$eq(((Short)obj).asShort()); + } +} diff --git a/sources/scala/Unit.java b/sources/scala/Unit.java new file mode 100644 index 0000000000..e86f295278 --- /dev/null +++ b/sources/scala/Unit.java @@ -0,0 +1,32 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id$ + +package scala; + +/** + * Scala's Unit class. + */ + +public abstract class Unit extends AnyVal { + public void asUnit() { + } + + public boolean equals(java.lang.Object obj) { + return obj instanceof Unit; + } + + public int hashCode() { + return 4041; + } + + public String toString() { + return "()"; + } +} |