Hoa central
Public Member Functions | Protected Attributes | List of all members
Hoa\Iterator\Lookbehind Class Reference
Inheritance diagram for Hoa\Iterator\Lookbehind:

Public Member Functions

 __construct (\Iterator $iterator)
 
 getInnerIterator ()
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 hasPrevious ()
 
 getPrevious ()
 
 getPreviousKey ()
 

Protected Attributes

 $_iterator = null
 
 $_previousKey = -1
 
 $_previousCurrent = null
 

Detailed Description

Class .

Look behind iterator.

Definition at line 47 of file Lookbehind.php.

Constructor & Destructor Documentation

Hoa\Iterator\Lookbehind::__construct ( \Iterator  $iterator)

Construct.

Parameters
\Iterator$iteratorIterator.
Returns
void

Definition at line 80 of file Lookbehind.php.

81  {
82  $this->_iterator = $iterator;
83 
84  return;
85  }

Member Function Documentation

Hoa\Iterator\Lookbehind::current ( )

Return the current element.

Returns
mixed

Definition at line 102 of file Lookbehind.php.

103  {
104  return $this->getInnerIterator()->current();
105  }

Here is the call graph for this function:

Here is the caller graph for this function:

Hoa\Iterator\Lookbehind::getInnerIterator ( )

Get inner iterator.

Returns

Definition at line 92 of file Lookbehind.php.

93  {
94  return $this->_iterator;
95  }

Here is the caller graph for this function:

Hoa\Iterator\Lookbehind::getPrevious ( )

Get previous value.

Returns
mixed

Definition at line 168 of file Lookbehind.php.

169  {
171  }
Hoa\Iterator\Lookbehind::getPreviousKey ( )

Get previous key.

Returns
mixed

Definition at line 178 of file Lookbehind.php.

179  {
180  return $this->_previousKey;
181  }
Hoa\Iterator\Lookbehind::hasPrevious ( )

Check whether there is a previous element.

Returns
bool

Definition at line 158 of file Lookbehind.php.

159  {
160  return -1 !== $this->_previousKey;
161  }
Hoa\Iterator\Lookbehind::key ( )

Return the key of the current element.

Returns
mixed

Definition at line 112 of file Lookbehind.php.

113  {
114  return $this->getInnerIterator()->key();
115  }

Here is the call graph for this function:

Here is the caller graph for this function:

Hoa\Iterator\Lookbehind::next ( )

Move forward to next element.

Returns
void

Definition at line 122 of file Lookbehind.php.

123  {
124  $this->_previousKey = $this->key();
125  $this->_previousCurrent = $this->current();
126 
127  return $this->getInnerIterator()->next();
128  }

Here is the call graph for this function:

Hoa\Iterator\Lookbehind::rewind ( )

Rewind the iterator to the first element.

Returns
void

Definition at line 135 of file Lookbehind.php.

136  {
137  $this->_previousKey = -1;
138  $this->_previousCurrent = null;
139 
140  return $this->getInnerIterator()->rewind();
141  }

Here is the call graph for this function:

Hoa\Iterator\Lookbehind::valid ( )

Check if current position is valid.

Returns
bool

Definition at line 148 of file Lookbehind.php.

149  {
150  return $this->getInnerIterator()->valid();
151  }

Here is the call graph for this function:

Member Data Documentation

Hoa\Iterator\Lookbehind::$_iterator = null
protected

Definition at line 56 of file Lookbehind.php.

Hoa\Iterator\Lookbehind::$_previousCurrent = null
protected

Definition at line 70 of file Lookbehind.php.

Hoa\Iterator\Lookbehind::$_previousKey = -1
protected

Definition at line 63 of file Lookbehind.php.


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