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