|
SPL-StandardPHPLibrary
|


Public Member Functions | |
| __call ($func, $params) | |
| current () | |
| getInnerIterator () | |
| key () | |
| next () | |
| rewind () | |
| valid () | |
An infinite Iterator.
This Iterator takes another Iterator and infinitvely iterates it by rewinding it when its end is reached.
$it = new ArrayIterator(array(1,2,3));
$infinite = new InfiniteIterator($it);
$limit = new LimitIterator($infinite, 0, 5);
foreach($limit as $val=>$key)
{
echo "$val=>$key\n";
}
Definition at line 33 of file infiniteiterator.inc.
| IteratorIterator::__call | ( | $ | func, |
| $ | params | ||
| ) | [inherited] |
Aggregate the inner iterator.
| func | Name of method to invoke |
| params | Array of parameters to pass to method |
Definition at line 110 of file iteratoriterator.inc.
{
return call_user_func_array(array($this->iterator, $func), $params);
}
| IteratorIterator::current | ( | ) | [inherited] |
Implements Iterator.
Definition at line 86 of file iteratoriterator.inc.
{
return $this->iterator->current();
}
| IteratorIterator::getInnerIterator | ( | ) | [inherited] |
Implements OuterIterator.
Definition at line 65 of file iteratoriterator.inc.
Referenced by next().
{
return $this->iterator;
}
| IteratorIterator::key | ( | ) | [inherited] |
Implements Iterator.
Definition at line 79 of file iteratoriterator.inc.
{
return $this->iterator->key();
}
| InfiniteIterator::next | ( | ) |
Move the inner Iterator forward to its next element or rewind it.
Reimplemented from IteratorIterator.
Definition at line 38 of file infiniteiterator.inc.
References IteratorIterator\getInnerIterator(), and IteratorIterator\valid().
{
$this->getInnerIterator()->next();
if (!$this->getInnerIterator()->valid())
{
$this->getInnerIterator()->rewind();
}
}

| IteratorIterator::rewind | ( | ) | [inherited] |
rewind to the first element
Implements Iterator.
Reimplemented in NoRewindIterator.
Definition at line 100 of file iteratoriterator.inc.
{
return $this->iterator->rewind();
}
| IteratorIterator::valid | ( | ) | [inherited] |
Implements Iterator.
Definition at line 72 of file iteratoriterator.inc.
Referenced by next().
{
return $this->iterator->valid();
}
1.7.5.1