summaryrefslogtreecommitdiff
path: root/src/dotnet-library/scala/runtime/BoxedByte.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotnet-library/scala/runtime/BoxedByte.java')
-rw-r--r--src/dotnet-library/scala/runtime/BoxedByte.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/dotnet-library/scala/runtime/BoxedByte.java b/src/dotnet-library/scala/runtime/BoxedByte.java
new file mode 100644
index 0000000000..2ab7d7dc29
--- /dev/null
+++ b/src/dotnet-library/scala/runtime/BoxedByte.java
@@ -0,0 +1,57 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $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 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);
+ }
+
+}