diff options
author | Martin Odersky <odersky@gmail.com> | 2008-05-21 13:56:51 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-05-21 13:56:51 +0000 |
commit | 7eea3c922d48e830ebf157baee652d65da75ed89 (patch) | |
tree | 377f5dbb931a54dc2758e2d3910c0d5a0f6489c4 /src/library | |
parent | 0425a6b3f7f5122024e2adbb8f595ce662acc574 (diff) | |
download | scala-7eea3c922d48e830ebf157baee652d65da75ed89.tar.gz scala-7eea3c922d48e830ebf157baee652d65da75ed89.tar.bz2 scala-7eea3c922d48e830ebf157baee652d65da75ed89.zip |
Fixed #677
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/runtime/BoxedAnyArray.scala | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/library/scala/runtime/BoxedAnyArray.scala b/src/library/scala/runtime/BoxedAnyArray.scala index 3e532cb5d5..0a251ab9c0 100644 --- a/src/library/scala/runtime/BoxedAnyArray.scala +++ b/src/library/scala/runtime/BoxedAnyArray.scala @@ -24,6 +24,50 @@ import compat.Platform @serializable final class BoxedAnyArray(val length: Int) extends BoxedArray { + def this(dim1: Int, dim2: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2)) + } + + def this(dim1: Int, dim2: Int, dim3: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6, dim7)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6, dim7, dim8)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6, dim7, dim8, dim9)) + } + + private def initializeWith(elem: Int => Any) = { + for (i <- 0 until length) update(i, elem(i)) + } + private var boxed = new Array[AnyRef](length) private val hash = boxed.hashCode() private var unboxed: AnyRef = null |