From 7e461c0c3175ec78f04eab506433b42bb378eea5 Mon Sep 17 00:00:00 2001 From: mihaylov Date: Tue, 13 Dec 2005 16:35:57 +0000 Subject: [PATCH] made serializable git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@5056 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- sources/scala/runtime/BoxedAnyArray.scala | 1 + sources/scala/runtime/BoxedBoolean.java | 4 +++- sources/scala/runtime/BoxedBooleanArray.scala | 1 + sources/scala/runtime/BoxedByte.java | 4 +++- sources/scala/runtime/BoxedByteArray.scala | 1 + sources/scala/runtime/BoxedChar.java | 4 +++- sources/scala/runtime/BoxedCharArray.scala | 1 + sources/scala/runtime/BoxedDouble.java | 4 +++- sources/scala/runtime/BoxedDoubleArray.scala | 1 + sources/scala/runtime/BoxedFloat.java | 4 +++- sources/scala/runtime/BoxedFloatArray.scala | 1 + sources/scala/runtime/BoxedInt.java | 4 +++- sources/scala/runtime/BoxedIntArray.scala | 1 + sources/scala/runtime/BoxedLong.java | 4 +++- sources/scala/runtime/BoxedLongArray.scala | 1 + sources/scala/runtime/BoxedShort.java | 4 +++- sources/scala/runtime/BoxedShortArray.scala | 1 + sources/scala/runtime/BoxedUnit.java | 4 +++- sources/scala/runtime/compat/StringBuilder.scala | 4 ++++ sources/scala/runtime/matching/NonTerm.scala | 4 ++-- 20 files changed, 42 insertions(+), 11 deletions(-) diff --git a/sources/scala/runtime/BoxedAnyArray.scala b/sources/scala/runtime/BoxedAnyArray.scala index ae8f2021d..cf4dc668e 100755 --- a/sources/scala/runtime/BoxedAnyArray.scala +++ b/sources/scala/runtime/BoxedAnyArray.scala @@ -12,6 +12,7 @@ package scala.runtime; /** Arrays created by new Array[T](length) where T is a type variable */ +[serializable] final class BoxedAnyArray(val length: Int) extends BoxedArray { private var boxed = new Array[Object](length); diff --git a/sources/scala/runtime/BoxedBoolean.java b/sources/scala/runtime/BoxedBoolean.java index 2f539849e..700ceef4c 100755 --- a/sources/scala/runtime/BoxedBoolean.java +++ b/sources/scala/runtime/BoxedBoolean.java @@ -10,7 +10,9 @@ package scala.runtime; -public final class BoxedBoolean { +public final class BoxedBoolean + implements java.io.Serializable +{ private final static BoxedBoolean TRUE = new BoxedBoolean(true); private final static BoxedBoolean FALSE = new BoxedBoolean(false); diff --git a/sources/scala/runtime/BoxedBooleanArray.scala b/sources/scala/runtime/BoxedBooleanArray.scala index f262bace8..69b0c55e6 100755 --- a/sources/scala/runtime/BoxedBooleanArray.scala +++ b/sources/scala/runtime/BoxedBooleanArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedBooleanArray(val value: Array[Boolean]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedByte.java b/sources/scala/runtime/BoxedByte.java index 24bd98579..7ffd72bff 100755 --- a/sources/scala/runtime/BoxedByte.java +++ b/sources/scala/runtime/BoxedByte.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public final class BoxedByte extends BoxedNumber { +public final class BoxedByte extends BoxedNumber + implements java.io.Serializable +{ private static final int MinHashed = -128; private static final int MaxHashed = 127; diff --git a/sources/scala/runtime/BoxedByteArray.scala b/sources/scala/runtime/BoxedByteArray.scala index c215c64da..673bbbac3 100755 --- a/sources/scala/runtime/BoxedByteArray.scala +++ b/sources/scala/runtime/BoxedByteArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedByteArray(val value: Array[Byte]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedChar.java b/sources/scala/runtime/BoxedChar.java index 6ae5fba4d..571808415 100755 --- a/sources/scala/runtime/BoxedChar.java +++ b/sources/scala/runtime/BoxedChar.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public class BoxedChar extends BoxedNumber { +public class BoxedChar extends BoxedNumber + implements java.io.Serializable +{ private static final int MinHashed = 0; private static final int MaxHashed = 255; diff --git a/sources/scala/runtime/BoxedCharArray.scala b/sources/scala/runtime/BoxedCharArray.scala index dae91679a..06d7554c9 100755 --- a/sources/scala/runtime/BoxedCharArray.scala +++ b/sources/scala/runtime/BoxedCharArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedCharArray(val value: Array[Char]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedDouble.java b/sources/scala/runtime/BoxedDouble.java index 4db14f709..439d08c97 100755 --- a/sources/scala/runtime/BoxedDouble.java +++ b/sources/scala/runtime/BoxedDouble.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public class BoxedDouble extends BoxedNumber { +public class BoxedDouble extends BoxedNumber + implements java.io.Serializable +{ public static BoxedDouble box(double value) { return new BoxedDouble(value); diff --git a/sources/scala/runtime/BoxedDoubleArray.scala b/sources/scala/runtime/BoxedDoubleArray.scala index 7a958ce4d..75c8ee3e1 100755 --- a/sources/scala/runtime/BoxedDoubleArray.scala +++ b/sources/scala/runtime/BoxedDoubleArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedDoubleArray(val value: Array[Double]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedFloat.java b/sources/scala/runtime/BoxedFloat.java index 76a3c92a8..f6b48b0fd 100755 --- a/sources/scala/runtime/BoxedFloat.java +++ b/sources/scala/runtime/BoxedFloat.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public class BoxedFloat extends BoxedNumber { +public class BoxedFloat extends BoxedNumber + implements java.io.Serializable +{ public static BoxedFloat box(float value) { return new BoxedFloat(value); diff --git a/sources/scala/runtime/BoxedFloatArray.scala b/sources/scala/runtime/BoxedFloatArray.scala index 4d9286520..956f9896a 100755 --- a/sources/scala/runtime/BoxedFloatArray.scala +++ b/sources/scala/runtime/BoxedFloatArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedFloatArray(val value: Array[Float]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedInt.java b/sources/scala/runtime/BoxedInt.java index af9b6c720..9ab99c3c7 100755 --- a/sources/scala/runtime/BoxedInt.java +++ b/sources/scala/runtime/BoxedInt.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public final class BoxedInt extends BoxedNumber { +public final class BoxedInt extends BoxedNumber + implements java.io.Serializable +{ private static final int MinHashed = -128; private static final int MaxHashed = 1024; diff --git a/sources/scala/runtime/BoxedIntArray.scala b/sources/scala/runtime/BoxedIntArray.scala index 00536cf5a..e782c00c5 100755 --- a/sources/scala/runtime/BoxedIntArray.scala +++ b/sources/scala/runtime/BoxedIntArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedIntArray(val value: Array[Int]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedLong.java b/sources/scala/runtime/BoxedLong.java index 7f1e9fc77..e914ec12d 100755 --- a/sources/scala/runtime/BoxedLong.java +++ b/sources/scala/runtime/BoxedLong.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public class BoxedLong extends BoxedNumber { +public class BoxedLong extends BoxedNumber + implements java.io.Serializable +{ public static BoxedLong box(long value) { return new BoxedLong(value); diff --git a/sources/scala/runtime/BoxedLongArray.scala b/sources/scala/runtime/BoxedLongArray.scala index ea65e9df4..816d5b5bf 100755 --- a/sources/scala/runtime/BoxedLongArray.scala +++ b/sources/scala/runtime/BoxedLongArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedLongArray(val value: Array[Long]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedShort.java b/sources/scala/runtime/BoxedShort.java index c89cdca5f..6cb61aa00 100755 --- a/sources/scala/runtime/BoxedShort.java +++ b/sources/scala/runtime/BoxedShort.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public final class BoxedShort extends BoxedNumber { +public final class BoxedShort extends BoxedNumber + implements java.io.Serializable +{ private static final int MinHashed = -128; private static final int MaxHashed = 127; diff --git a/sources/scala/runtime/BoxedShortArray.scala b/sources/scala/runtime/BoxedShortArray.scala index 308a52040..97938e34d 100755 --- a/sources/scala/runtime/BoxedShortArray.scala +++ b/sources/scala/runtime/BoxedShortArray.scala @@ -10,6 +10,7 @@ package scala.runtime; +[serializable] final class BoxedShortArray(val value: Array[Short]) extends BoxedArray { def length: Int = value.length; diff --git a/sources/scala/runtime/BoxedUnit.java b/sources/scala/runtime/BoxedUnit.java index 80f5f2e1b..c896350a8 100755 --- a/sources/scala/runtime/BoxedUnit.java +++ b/sources/scala/runtime/BoxedUnit.java @@ -7,7 +7,9 @@ \* */ package scala.runtime; -public final class BoxedUnit { +public final class BoxedUnit + implements java.io.Serializable +{ public final static BoxedUnit UNIT = new BoxedUnit(); diff --git a/sources/scala/runtime/compat/StringBuilder.scala b/sources/scala/runtime/compat/StringBuilder.scala index f2dbab804..bfb790723 100644 --- a/sources/scala/runtime/compat/StringBuilder.scala +++ b/sources/scala/runtime/compat/StringBuilder.scala @@ -17,6 +17,10 @@ class StringBuilder { str.append(x); this } + def append(x: String): StringBuilder = { + str.append(x); + this + } def length(): Int = str.length(); override def toString() = str.toString(); } diff --git a/sources/scala/runtime/matching/NonTerm.scala b/sources/scala/runtime/matching/NonTerm.scala index 48c76d808..86defb4b0 100644 --- a/sources/scala/runtime/matching/NonTerm.scala +++ b/sources/scala/runtime/matching/NonTerm.scala @@ -46,7 +46,7 @@ case class HedgeNT(i:int) extends NonTerm with Ordered[HedgeNT] { } }; -object EMPTYHEDGE extends HedgeNT( 0, true ) ; -object ANYHEDGE extends HedgeNT( 1, true ) ; +//case object EMPTYHEDGE extends HedgeNT( 0, true ) ; +//case object ANYHEDGE extends HedgeNT( 1, true ) ; object ANYTREE extends TreeNT( 1 );