40 throw new exception(
'Parameter offset must be > 0');
43 throw new exception(
'Parameter count must either be -1 or a value greater than or equal to 0');
57 if ($position < $this->offset) {
58 throw new exception(
'Cannot seek to '.$position.
' which is below offset '.$this->offset);
60 if ($position > $this->offset + $this->count && $this->count != -1) {
61 throw new exception(
'Cannot seek to '.$position.
' which is behind offset '.$this->offset.
' plus count '.$this->count);
64 $this->it->seek($position);
65 $this->pos = $position;
67 while($this->pos < $position && $this->it->valid()) {
79 $this->
seek($this->offset);
85 return ($this->count == -1 || $this->pos < $this->offset + $this->count)
86 && $this->it->valid();
92 return $this->it->key();
98 return $this->it->current();
130 return call_user_func_array(array($this->it, $func), $params);
Limited Iteration over another Iterator.
next()
Forward to nect element.
Interface to access the current inner iteraor of iterator wrappers.
rewind()
Rewind to offset specified in constructor.
seek($position)
Seek to specified position.
__call($func, $params)
Aggregate the inner iterator.
__construct(Iterator $it, $offset=0, $count=-1)
Construct.