diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2009-05-27 19:35:02 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2009-05-27 19:35:02 +0000 |
commit | cc5e79c9ec9cea8d0f22020b528877d8f6e00153 (patch) | |
tree | 94e43f77c7b7271b3d0b6f9fb7372ae83b39360d /src/cldc-library | |
parent | 4b8be5d8bec86358276407d6521c41702ccda835 (diff) | |
download | scala-cc5e79c9ec9cea8d0f22020b528877d8f6e00153.tar.gz scala-cc5e79c9ec9cea8d0f22020b528877d8f6e00153.tar.bz2 scala-cc5e79c9ec9cea8d0f22020b528877d8f6e00153.zip |
In "Iterable" and in all its subclasses, "itera...
In "Iterable" and in all its subclasses, "iterator" replaces "elements"
(and assorted changes).
Diffstat (limited to 'src/cldc-library')
-rw-r--r-- | src/cldc-library/scala/Array.scala | 20 | ||||
-rw-r--r-- | src/cldc-library/scala/List.scala | 4 | ||||
-rw-r--r-- | src/cldc-library/scala/Predef.scala | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/cldc-library/scala/Array.scala b/src/cldc-library/scala/Array.scala index 0ba96c71a6..f37c7f56b0 100644 --- a/src/cldc-library/scala/Array.scala +++ b/src/cldc-library/scala/Array.scala @@ -81,7 +81,7 @@ object Array { def apply[A <: AnyRef](xs: A*): Array[A] = { val array = new Array[A](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } @@ -97,7 +97,7 @@ object Array { def Array[A](xs: A*): Array[A] = { val array = new Array[A](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } */ @@ -105,43 +105,43 @@ object Array { def apply(xs: Boolean*): Array[Boolean] = { val array = new Array[Boolean](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } def apply(xs: Byte*): Array[Byte] = { val array = new Array[Byte](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } def apply(xs: Short*): Array[Short] = { val array = new Array[Short](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } def apply(xs: Char*): Array[Char] = { val array = new Array[Char](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } def apply(xs: Int*): Array[Int] = { val array = new Array[Int](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } def apply(xs: Long*): Array[Long] = { val array = new Array[Long](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } def apply(xs: Unit*): Array[Unit] = { val array = new Array[Unit](xs.length) var i = 0 - for (x <- xs.elements) { array(i) = x; i += 1 } + for (x <- xs.iterator) { array(i) = x; i += 1 } array } @@ -297,7 +297,7 @@ final class Array[A](_length: Int) extends Array.Array0[A] { /** An iterator returning the elements of this array, starting from 0. */ - override def elements: Iterator[A] = throw new Error() + override def iterator: Iterator[A] = throw new Error() /** @deprecated use <code>slice(from,end).force</code> instead */ def subArray(from: Int, end: Int): Array[A] = throw new Error() diff --git a/src/cldc-library/scala/List.scala b/src/cldc-library/scala/List.scala index f32a50d421..71bf2f1ca2 100644 --- a/src/cldc-library/scala/List.scala +++ b/src/cldc-library/scala/List.scala @@ -501,7 +501,7 @@ sealed abstract class List[+A] extends Seq[A] { * * @return an iterator on the list elements. */ - override def elements: Iterator[A] = new Iterator[A] { + override def iterator: Iterator[A] = new Iterator[A] { var these = List.this def hasNext: Boolean = !these.isEmpty def next: A = @@ -1027,7 +1027,7 @@ sealed abstract class List[+A] extends Seq[A] { val b = new ListBuffer[B] var these = this while (!these.isEmpty) { - var those = f(these.head).elements + var those = f(these.head).iterator while (those.hasNext) { b += those.next } diff --git a/src/cldc-library/scala/Predef.scala b/src/cldc-library/scala/Predef.scala index 26a5b08a16..bbb4478412 100644 --- a/src/cldc-library/scala/Predef.scala +++ b/src/cldc-library/scala/Predef.scala @@ -165,8 +165,8 @@ object Predef { val self = xs def compare(that: Iterable[A]): Int = { var res = 0 - val these = xs.elements - val those = that.elements + val these = xs.iterator + val those = that.iterator while (res == 0 && these.hasNext) res = if (those.hasNext) these.next compare those.next else 1 if (res == 0) { |