diff options
-rwxr-xr-x | src/library/scala/CountedIterator.scala | 25 |
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 + +} |