]> granicus.if.org Git - php/commitdiff
- Update
authorMarcus Boerger <helly@php.net>
Sun, 31 Oct 2004 15:36:08 +0000 (15:36 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 31 Oct 2004 15:36:08 +0000 (15:36 +0000)
ext/spl/examples/norewinditerator.inc

index cdd030c990bba1231ac17d18906940d81856e076..dbf69c5531bbff5004e2df5af393faf0152d4ef2 100755 (executable)
 /** @ingroup Examples
  * @brief   An Iterator that doesn't call rewind
  * @author  Marcus Boerger
- * @version 1.0
+ * @version 1.1
  *
  */
-class NoRewindIterator implements OuterIterator
+class NoRewindIterator extends IteratorIterator
 {
-       protected $it;
-       
-       function __construct(Iterator $it)
-       {
-               $this->it = $it;
-       }
-
+       /** Simply prevent execution of inner iterators rewind().
+        */
        function rewind()
        {
                // nothing to do
        }
-
-       function valid()
-       {
-               return $this->getInnerIterator()->valid();
-       }
-
-       function current()
-       {
-               return $this->getInnerIterator()->current();
-       }
-
-       function key()
-       {
-               return $this->getInnerIterator()->key();
-       }
-
-       function next()
-       {
-               $this->getInnerIterator()->next();
-       }
-       
-       function getInnerIterator()
-       {
-               return $this->it;
-       }
 }
 
 ?>
\ No newline at end of file