summaryrefslogtreecommitdiff
path: root/src/library/scala/Product.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-12-09 17:40:50 +0000
committerMartin Odersky <odersky@gmail.com>2008-12-09 17:40:50 +0000
commitf83d8977544ec7fc3eed59e032e3705f30290c00 (patch)
tree2109641f8f4d84630726637ed480e0512c99e1d5 /src/library/scala/Product.scala
parent4d32e17513cf46b786eef8523653ac366c73a09c (diff)
downloadscala-f83d8977544ec7fc3eed59e032e3705f30290c00.tar.gz
scala-f83d8977544ec7fc3eed59e032e3705f30290c00.tar.bz2
scala-f83d8977544ec7fc3eed59e032e3705f30290c00.zip
updates to scalax collections and standard libr...
updates to scalax collections and standard library classes.
Diffstat (limited to 'src/library/scala/Product.scala')
-rw-r--r--src/library/scala/Product.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala
index 7e5cf10cae..351b360f69 100644
--- a/src/library/scala/Product.scala
+++ b/src/library/scala/Product.scala
@@ -32,6 +32,13 @@ trait Product extends AnyRef {
*/
def productArity: Int
+ def productElements: Iterator[Any] = new Iterator[Any] {
+ private var c: Int = 0
+ private val cmax = productArity
+ def hasNext = c < cmax
+ def next() = { val result = productElement(c); c += 1; result }
+ }
+
/**
* By default the empty string. Implementations may override this
* method in order to prepend a string prefix to the result of the