- Update docu

This commit is contained in:
Marcus Boerger 2005-03-01 23:44:05 +00:00
parent 0b3ed59fb6
commit f33adafab7
2 changed files with 13 additions and 5 deletions

View file

@ -25,17 +25,24 @@ interface SeekableIterator implements Iterator
* \param $index position to seek to * \param $index position to seek to
* \return void * \return void
* *
* \note The method should throw an exception if it is not possible to * The method should throw an exception if it is not possible to seek to
* seek to the given position. * the given position. Typically this exception should be of type
*/ * OutOfBoundsException.
\code
function seek($index); function seek($index);
/* $this->rewind(); $this->rewind();
$position = 0; $position = 0;
while($position < $index && $this->valid()) { while($position < $index && $this->valid()) {
$this->next(); $this->next();
$position++; $position++;
} }
}*/ if (!$this->valid()) {
throw new OutOfBoundsException('Invalid seek position');
}
}
\endcode
*/
function seek($index);
} }
?> ?>

View file

@ -548,6 +548,7 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Countable
function getArrayCopy(); function getArrayCopy();
/** @param $position offset to seek to /** @param $position offset to seek to
* @throw OutOfBoundsException if $position is invalid
*/ */
function seek($position); function seek($position);