diff options
Diffstat (limited to 'src/library/scala/runtime/BoxedLongArray.scala')
-rw-r--r-- | src/library/scala/runtime/BoxedLongArray.scala | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/library/scala/runtime/BoxedLongArray.scala b/src/library/scala/runtime/BoxedLongArray.scala new file mode 100644 index 0000000000..624e992e01 --- /dev/null +++ b/src/library/scala/runtime/BoxedLongArray.scala @@ -0,0 +1,33 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2005, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id$ + +package scala.runtime; + +[serializable] +final class BoxedLongArray(val value: Array[Long]) extends BoxedArray { + + def length: Int = value.length; + + def apply(index: Int): Object = BoxedLong.box(value(index)); + + def update(index: Int, elem: Object): Unit = { + value(index) = elem.asInstanceOf[BoxedNumber].longValue() + } + + def unbox(elemTag: String): Object = value; + + override def equals(other: Any) = ( + value == other || + other.isInstanceOf[BoxedLongArray] && value == other.asInstanceOf[BoxedLongArray].value + ); + + override def hashCode(): Int = value.hashCode(); +} + |