<?php
class Enumerator{
var $postition;
var $elements;
function Enumerator(){
$this->reset();
}
function setElements( &$elements ){
$this->reset();
$this->elements = &$elements;
}
function reset(){
$this->position = -1;
}
function moveNext(){
if ( $this->isNotLastElements() ){
$this->position++;
return true;
}
else{
return false;
}
}
function getElement(){
return $this->elements[ $this->position ];
}
function isNotLastElements(){
return $this->position < ( count( $this->elements )-1 );
}
} // end class
?>