diff options
Diffstat (limited to 'newsources')
-rwxr-xr-x | newsources/scala/Array.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/newsources/scala/Array.scala b/newsources/scala/Array.scala new file mode 100755 index 0000000000..068d4813d0 --- /dev/null +++ b/newsources/scala/Array.scala @@ -0,0 +1,24 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + +// $Id$ + +package scala; + +/** @meta class [?T] extends scala.AnyRef with java.lang.Cloneable with java.io.Serializable; */ +abstract class Array[T](val length: Int) extends Cloneable with java.io.Serializable with Seq[T] { + + def apply(i: Int): T; + def update(i: Int, x: T): Unit; + + def elements = new Iterator[T] { + var index = 0; + def hasNext: Boolean = index < length; + def next: T = { val i = index; index = i + 1; apply(i) } + } +} |