mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-03 00:54:48 +00:00
a3d40de283
--HG-- branch : gsoc2012-achievements
25 lines
No EOL
447 B
PHP
25 lines
No EOL
447 B
PHP
<?php
|
|
class NodeIterator {
|
|
private $nodes;
|
|
private $curr;
|
|
|
|
function NodeIterator(&$nodes) {
|
|
$this->nodes = $nodes;
|
|
$this->curr = 0;
|
|
}
|
|
|
|
function hasNext() {
|
|
$tmp = array_keys($this->nodes);
|
|
return isset($this->nodes[$tmp[$this->curr]]);
|
|
}
|
|
|
|
function getNext() {
|
|
$tmp = array_keys($this->nodes);
|
|
return $this->nodes[$tmp[$this->curr++]];
|
|
}
|
|
|
|
function first() {
|
|
$this->curr = 0;
|
|
}
|
|
}
|
|
?>
|