SPL-StandardPHPLibrary
Public Member Functions | List of all members
NoRewindIterator Class Reference
Inheritance diagram for NoRewindIterator:
Inheritance graph
Collaboration diagram for NoRewindIterator:
Collaboration graph

Public Member Functions

 __call ($func, $params)
 
 current ()
 
 getInnerIterator ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Detailed Description

An Iterator wrapper that doesn't call rewind.

Author
Marcus Boerger
Version
1.1
Since
PHP 5.1

Definition at line 18 of file norewinditerator.inc.

Member Function Documentation

IteratorIterator::__call (   $func,
  $params 
)
inherited

Aggregate the inner iterator.

Parameters
funcName of method to invoke
paramsArray of parameters to pass to method

Definition at line 110 of file iteratoriterator.inc.

111  {
112  return call_user_func_array(array($this->iterator, $func), $params);
113  }
IteratorIterator::current ( )
inherited
Returns
current value

Implements Iterator.

Definition at line 86 of file iteratoriterator.inc.

87  {
88  return $this->iterator->current();
89  }
IteratorIterator::getInnerIterator ( )
inherited
Returns
the inner iterator as passed to the constructor

Implements OuterIterator.

Definition at line 65 of file iteratoriterator.inc.

References IteratorIterator\$iterator.

Referenced by InfiniteIterator\next().

66  {
67  return $this->iterator;
68  }
$iterator
The inner iterator must be private because when this class will be converted to c code it won't no lo...
IteratorIterator::key ( )
inherited
Returns
current key

Implements Iterator.

Definition at line 79 of file iteratoriterator.inc.

80  {
81  return $this->iterator->key();
82  }
IteratorIterator::next ( )
inherited

forward to next element

Implements Iterator.

Definition at line 93 of file iteratoriterator.inc.

94  {
95  return $this->iterator->next();
96  }
NoRewindIterator::rewind ( )

Simply prevent execution of inner iterators rewind().

Implements Iterator.

Definition at line 22 of file norewinditerator.inc.

23  {
24  // nothing to do
25  }
IteratorIterator::valid ( )
inherited
Returns
whether the iterator is valid

Implements Iterator.

Definition at line 72 of file iteratoriterator.inc.

Referenced by InfiniteIterator\next().

73  {
74  return $this->iterator->valid();
75  }

The documentation for this class was generated from the following file: