Lines Matching refs:iterator
16 * This iterator wrapper allows to convert anything that is traversable into
36 * downcast to is actually a base class of the specified iterator to wrap.
44 * @param iterator inner iterator
45 * @param classname optional class the iterator has to be downcasted to
47 function __construct(Traversable $iterator, $classname = null)
49 if ($iterator instanceof IteratorAggregate)
51 $iterator = $iterator->getIterator();
53 if ($iterator instanceof Iterator)
55 $this->iterator = $iterator;
63 /** \return the inner iterator as passed to the constructor
67 return $this->iterator;
70 /** \return whether the iterator is valid
74 return $this->iterator->valid();
81 return $this->iterator->key();
88 return $this->iterator->current();
95 return $this->iterator->next();
102 return $this->iterator->rewind();
105 /** Aggregate the inner iterator
112 return call_user_func_array(array($this->iterator, $func), $params);
115 /** The inner iterator must be private because when this class will be
118 private $iterator;