Hoa central
Lookbehind.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Iterator;
38 
48  extends IteratorIterator
49  implements Outer
50 {
56  protected $_iterator = null;
57 
63  protected $_previousKey = -1;
64 
70  protected $_previousCurrent = null;
71 
72 
73 
80  public function __construct(\Iterator $iterator)
81  {
82  $this->_iterator = $iterator;
83 
84  return;
85  }
86 
92  public function getInnerIterator()
93  {
94  return $this->_iterator;
95  }
96 
102  public function current()
103  {
104  return $this->getInnerIterator()->current();
105  }
106 
112  public function key()
113  {
114  return $this->getInnerIterator()->key();
115  }
116 
122  public function next()
123  {
124  $this->_previousKey = $this->key();
125  $this->_previousCurrent = $this->current();
126 
127  return $this->getInnerIterator()->next();
128  }
129 
135  public function rewind()
136  {
137  $this->_previousKey = -1;
138  $this->_previousCurrent = null;
139 
140  return $this->getInnerIterator()->rewind();
141  }
142 
148  public function valid()
149  {
150  return $this->getInnerIterator()->valid();
151  }
152 
158  public function hasPrevious()
159  {
160  return -1 !== $this->_previousKey;
161  }
162 
168  public function getPrevious()
169  {
171  }
172 
178  public function getPreviousKey()
179  {
180  return $this->_previousKey;
181  }
182 }
__construct(\Iterator $iterator)
Definition: Lookbehind.php:80