]> granicus.if.org Git - php/commitdiff
- Update docu
authorMarcus Boerger <helly@php.net>
Tue, 1 Mar 2005 23:44:05 +0000 (23:44 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 1 Mar 2005 23:44:05 +0000 (23:44 +0000)
ext/spl/internal/seekableiterator.inc
ext/spl/spl.php

index 586be27a7bc34f4c6fdb6df56e70444e8d4e8123..c00d264a952766cd76adf37ef1017c4020071f8a 100755 (executable)
@@ -25,17 +25,24 @@ interface SeekableIterator implements Iterator
         * \param $index position to seek to
         * \return void
         *
-        * \note The method should throw an exception if it is not possible to
-        *       seek to the given position.
-        */
+        * The method should throw an exception if it is not possible to seek to 
+        * the given position. Typically this exception should be of type 
+        * OutOfBoundsException.
+        \code
        function seek($index);
-/*             $this->rewind();
+               $this->rewind();
                $position = 0;
                while($position < $index && $this->valid()) {
                        $this->next();
                        $position++;
                }
-       }*/
+               if (!$this->valid()) {
+                       throw new OutOfBoundsException('Invalid seek position');
+               }
+       }
+        \endcode
+        */
+       function seek($index);
 }
 
 ?>
\ No newline at end of file
index dcf10f0c21051f723fd24250dbfbc9bcbf3880ae..b3c699a4d26c02e7c86b4b89eb8bd7d43cdb1e3b 100755 (executable)
@@ -548,6 +548,7 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Countable
        function getArrayCopy();
 
        /** @param $position offset to seek to
+        * @throw OutOfBoundsException if $position is invalid
         */
        function seek($position);