summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-12-21 14:12:47 +0000
committerMartin Odersky <odersky@gmail.com>2005-12-21 14:12:47 +0000
commit34e7849596ebe23b51b6867e8fa98d963df8317d (patch)
tree8a4407fd56ce3f6c216ac50e017dcabe2a9db3f2
parent99b6474dabc8a4bcc9282f041d48fb9671c4f2b8 (diff)
downloadscala-34e7849596ebe23b51b6867e8fa98d963df8317d.tar.gz
scala-34e7849596ebe23b51b6867e8fa98d963df8317d.tar.bz2
scala-34e7849596ebe23b51b6867e8fa98d963df8317d.zip
-rwxr-xr-xsrc/library/scala/CountedIterator.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/library/scala/CountedIterator.scala b/src/library/scala/CountedIterator.scala
new file mode 100755
index 0000000000..e7a239c882
--- /dev/null
+++ b/src/library/scala/CountedIterator.scala
@@ -0,0 +1,25 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2003, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+** $Id:BufferedIterator.scala 5359 2005-12-16 16:33:49 +0100 (Fri, 16 Dec 2005) dubochet $
+\* */
+
+package scala;
+
+
+/** Buffered iterators are iterators which allow to inspect the next
+ * element without discarding it.
+ *
+ * @author Martin Odersky
+ * @version 1.0, 16/07/2003
+ */
+trait CountedIterator[+A] extends Iterator[A] {
+
+ /** counts the elements in this iterator; counts start at 0
+ */
+ def count: Int
+
+}