From 61da956077db2335a5d7fd9290ad31dc3bfe9e92 Mon Sep 17 00:00:00 2001 From: Gilles Dubochet Date: Tue, 1 May 2007 16:18:11 +0000 Subject: New STARR based on rev. --- src/library/scala/runtime/BoxedBoolean.java | 44 ---------------------- src/library/scala/runtime/BoxedByte.java | 57 ---------------------------- src/library/scala/runtime/BoxedChar.java | 58 ----------------------------- src/library/scala/runtime/BoxedDouble.java | 49 ------------------------ src/library/scala/runtime/BoxedFloat.java | 48 ------------------------ src/library/scala/runtime/BoxedInt.java | 57 ---------------------------- src/library/scala/runtime/BoxedLong.java | 49 ------------------------ src/library/scala/runtime/BoxedNumber.java | 23 ------------ src/library/scala/runtime/BoxedShort.java | 58 ----------------------------- 9 files changed, 443 deletions(-) delete mode 100644 src/library/scala/runtime/BoxedBoolean.java delete mode 100644 src/library/scala/runtime/BoxedByte.java delete mode 100644 src/library/scala/runtime/BoxedChar.java delete mode 100644 src/library/scala/runtime/BoxedDouble.java delete mode 100644 src/library/scala/runtime/BoxedFloat.java delete mode 100644 src/library/scala/runtime/BoxedInt.java delete mode 100644 src/library/scala/runtime/BoxedLong.java delete mode 100644 src/library/scala/runtime/BoxedNumber.java delete mode 100644 src/library/scala/runtime/BoxedShort.java (limited to 'src/library') diff --git a/src/library/scala/runtime/BoxedBoolean.java b/src/library/scala/runtime/BoxedBoolean.java deleted file mode 100644 index 7105645256..0000000000 --- a/src/library/scala/runtime/BoxedBoolean.java +++ /dev/null @@ -1,44 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public final class BoxedBoolean - implements java.io.Serializable -{ - - private final static BoxedBoolean TRUE = new BoxedBoolean(true); - private final static BoxedBoolean FALSE = new BoxedBoolean(false); - - public static BoxedBoolean box(boolean value) { - return (value ? TRUE : FALSE); - } - - public final boolean value; - - private BoxedBoolean(boolean value) { this.value = value; } - - public final boolean booleanValue() { return value; } - - public boolean equals(java.lang.Object other) { - return this == other; - } - - public int hashCode() { - return value ? 1 : 0; - } - - public String toString() { - return String.valueOf(value); - } - -} diff --git a/src/library/scala/runtime/BoxedByte.java b/src/library/scala/runtime/BoxedByte.java deleted file mode 100644 index 93674b890d..0000000000 --- a/src/library/scala/runtime/BoxedByte.java +++ /dev/null @@ -1,57 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public final class BoxedByte extends BoxedNumber - implements java.io.Serializable -{ - - private static final int MinHashed = -128; - private static final int MaxHashed = 127; - private static final BoxedByte[] canonical = new BoxedByte[MaxHashed - MinHashed + 1]; - - static { - for (int i = MinHashed; i <= MaxHashed; i++) - canonical[i - MinHashed] = new BoxedByte((byte)i); - } - - public static BoxedByte box(byte value) { - return canonical[value - MinHashed]; - } - - public final byte value; - - private BoxedByte(byte value) { this.value = value; } - - public byte byteValue() { return (byte)value; } - public short shortValue() { return (short)value; } - public char charValue() { return (char)value; } - public int intValue() { return (int)value; } - public long longValue() { return (long)value; } - public float floatValue() { return (float)value; } - public double doubleValue() { return (double)value; } - - public boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).byteValue(); - } - - public int hashCode() { - return value; - } - - public String toString() { - return String.valueOf(value); - } - -} diff --git a/src/library/scala/runtime/BoxedChar.java b/src/library/scala/runtime/BoxedChar.java deleted file mode 100644 index 3e153f199b..0000000000 --- a/src/library/scala/runtime/BoxedChar.java +++ /dev/null @@ -1,58 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public class BoxedChar extends BoxedNumber - implements java.io.Serializable -{ - - private static final int MinHashed = 0; - private static final int MaxHashed = 255; - private static final BoxedChar[] canonical = new BoxedChar[MaxHashed - MinHashed + 1]; - - static { - for (int i = MinHashed; i <= MaxHashed; i++) - canonical[i - MinHashed] = new BoxedChar((char)i); - } - - public static BoxedChar box(char value) { - if (MinHashed <= value && value <= MaxHashed) return canonical[value - MinHashed]; - else return new BoxedChar(value); - } - - public final char value; - - private BoxedChar(char value) { this.value = value; } - - public byte byteValue() { return (byte)value; } - public short shortValue() { return (short)value; } - public char charValue() { return (char)value; } - public int intValue() { return (int)value; } - public long longValue() { return (long)value; } - public float floatValue() { return (float)value; } - public double doubleValue() { return (double)value; } - - public boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).charValue(); - } - - public int hashCode() { - return value; - } - - public String toString() { - return String.valueOf(value); - } - -} diff --git a/src/library/scala/runtime/BoxedDouble.java b/src/library/scala/runtime/BoxedDouble.java deleted file mode 100644 index 858946330b..0000000000 --- a/src/library/scala/runtime/BoxedDouble.java +++ /dev/null @@ -1,49 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public class BoxedDouble extends BoxedNumber - implements java.io.Serializable -{ - - public static BoxedDouble box(double value) { - return new BoxedDouble(value); - } - - public final double value; - - private BoxedDouble(double value) { this.value = value; } - - public final byte byteValue() { return (byte)value; } - public final short shortValue() { return (short)value; } - public final char charValue() { return (char)value; } - public final int intValue() { return (int)value; } - public final long longValue() { return (long)value; } - public final float floatValue() { return (float)value; } - public final double doubleValue() { return (double)value; } - - public boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).doubleValue(); - } - - public int hashCode() { - long bits = java.lang.Double.doubleToLongBits(value); - return (int)(bits ^ (bits >>> 32)); - } - - public String toString() { - return String.valueOf(value); - } - -} diff --git a/src/library/scala/runtime/BoxedFloat.java b/src/library/scala/runtime/BoxedFloat.java deleted file mode 100644 index 188eb3cb4e..0000000000 --- a/src/library/scala/runtime/BoxedFloat.java +++ /dev/null @@ -1,48 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public class BoxedFloat extends BoxedNumber - implements java.io.Serializable -{ - - public static BoxedFloat box(float value) { - return new BoxedFloat(value); - } - - public final float value; - - private BoxedFloat(float value) { this.value = value; } - - public final byte byteValue() { return (byte)value; } - public final short shortValue() { return (short)value; } - public final char charValue() { return (char)value; } - public final int intValue() { return (int)value; } - public final long longValue() { return (long)value; } - public final float floatValue() { return (float)value; } - public final double doubleValue() { return (double)value; } - - public boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).floatValue(); - } - - public int hashCode() { - return java.lang.Float.floatToIntBits(value); - } - - public String toString() { - return String.valueOf(value); - } - -} diff --git a/src/library/scala/runtime/BoxedInt.java b/src/library/scala/runtime/BoxedInt.java deleted file mode 100644 index 8f17aced74..0000000000 --- a/src/library/scala/runtime/BoxedInt.java +++ /dev/null @@ -1,57 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public final class BoxedInt extends BoxedNumber - implements java.io.Serializable -{ - - private static final int MinHashed = -128; - private static final int MaxHashed = 1024; - private static final BoxedInt[] canonical = new BoxedInt[MaxHashed - MinHashed + 1]; - - static { - for (int i = MinHashed; i <= MaxHashed; i++) - canonical[i - MinHashed] = new BoxedInt(i); - } - - public static BoxedInt box(int value) { - if (MinHashed <= value && value <= MaxHashed) return canonical[value - MinHashed]; - else return new BoxedInt(value); - } - - public final int value; - - private BoxedInt(int value) { this.value = value; } - - public final byte byteValue() { return (byte)value; } - public final short shortValue() { return (short)value; } - public final char charValue() { return (char)value; } - public final int intValue() { return (int)value; } - public final long longValue() { return (long)value; } - public final float floatValue() { return (float)value; } - public final double doubleValue() { return (double)value; } - - public final boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).intValue(); - } - - public final int hashCode() { - return value; - } - - public final String toString() { - return String.valueOf(value); - } -} diff --git a/src/library/scala/runtime/BoxedLong.java b/src/library/scala/runtime/BoxedLong.java deleted file mode 100644 index 9ea64c6241..0000000000 --- a/src/library/scala/runtime/BoxedLong.java +++ /dev/null @@ -1,49 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public class BoxedLong extends BoxedNumber - implements java.io.Serializable -{ - - public static BoxedLong box(long value) { - return new BoxedLong(value); - } - - public final long value; - - private BoxedLong(long value) { this.value = value; } - - public final byte byteValue() { return (byte)value; } - public final short shortValue() { return (short)value; } - public final char charValue() { return (char)value; } - public final int intValue() { return (int)value; } - public final long longValue() { return (long)value; } - public final float floatValue() { return (float)value; } - public final double doubleValue() { return (double)value; } - - public boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).longValue(); - } - - public int hashCode() { - long bits = value; - return (int)(bits ^ (bits >>> 32)); - } - - public String toString() { - return String.valueOf(value); - } - -} diff --git a/src/library/scala/runtime/BoxedNumber.java b/src/library/scala/runtime/BoxedNumber.java deleted file mode 100644 index e811cfc5d2..0000000000 --- a/src/library/scala/runtime/BoxedNumber.java +++ /dev/null @@ -1,23 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public abstract class BoxedNumber { - public abstract byte byteValue(); - public abstract short shortValue(); - public abstract char charValue(); - public abstract int intValue(); - public abstract long longValue(); - public abstract float floatValue(); - public abstract double doubleValue(); -} diff --git a/src/library/scala/runtime/BoxedShort.java b/src/library/scala/runtime/BoxedShort.java deleted file mode 100644 index 43907687c8..0000000000 --- a/src/library/scala/runtime/BoxedShort.java +++ /dev/null @@ -1,58 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.runtime; - - -public final class BoxedShort extends BoxedNumber - implements java.io.Serializable -{ - - private static final int MinHashed = -128; - private static final int MaxHashed = 127; - private static final BoxedShort[] canonical = new BoxedShort[MaxHashed - MinHashed + 1]; - - static { - for (int i = MinHashed; i <= MaxHashed; i++) - canonical[i - MinHashed] = new BoxedShort((short)i); - } - - public static BoxedShort box(short value) { - if (MinHashed <= value && value <= MaxHashed) return canonical[value - MinHashed]; - else return new BoxedShort(value); - } - - public final short value; - - private BoxedShort(short value) { this.value = value; } - - public byte byteValue() { return (byte)value; } - public short shortValue() { return (short)value; } - public char charValue() { return (char)value; } - public int intValue() { return (int)value; } - public long longValue() { return (long)value; } - public float floatValue() { return (float)value; } - public double doubleValue() { return (double)value; } - - public boolean equals(java.lang.Object other) { - return other instanceof BoxedNumber && - value == ((BoxedNumber) other).shortValue(); - } - - public int hashCode() { - return value; - } - - public String toString() { - return String.valueOf(value); - } - -} -- cgit v1.2.3