| 1 | <?php |
||
| 8 | class AnyIterator extends GenericIterator |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Row Elements |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | private $list; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Current row number |
||
| 19 | * @var int |
||
| 20 | */ |
||
| 21 | private $curRow; //int |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Iterator constructor |
||
| 25 | * |
||
| 26 | *@param Row[] $list |
||
| 27 | */ |
||
| 28 | |||
| 29 | 13 | public function __construct($list) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * How many elements have |
||
| 37 | * @return int |
||
| 38 | */ |
||
| 39 | 13 | public function count() |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Ask the Iterator is exists more rows. Use before moveNext method. |
||
| 46 | * @return bool True if exist more rows, otherwise false |
||
| 47 | */ |
||
| 48 | 12 | public function hasNext() |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Return the next row. |
||
| 55 | * |
||
| 56 | *@return Row |
||
| 57 | */ |
||
| 58 | 12 | public function moveNext() |
|
| 65 | |||
| 66 | public function key() |
||
| 70 | } |
||
| 71 |