| Package | system.collections | 
|---|---|
| Inheritance | class CQueueIterator | 
| Implements | Iterator, Traversable | 
| Since | 1.0 | 
| Version | $Id$ | 
| Source Code | framework/collections/CQueueIterator.php | 
| Method | Description | Defined By | 
|---|---|---|
| __construct() | Constructor. | CQueueIterator | 
| current() | Returns the current array item. | CQueueIterator | 
| key() | Returns the key of the current array item. | CQueueIterator | 
| next() | Moves the internal pointer to the next array item. | CQueueIterator | 
| rewind() | Rewinds internal array pointer. | CQueueIterator | 
| valid() | Returns whether there is an item at current position. | CQueueIterator | 
|    public void __construct(array &$data)   | ||
| $data | array | the data to be iterated through | 
 public function __construct(&$data)
{
    $this->_d=&$data;
    $this->_i=0;
    $this->_c=count($this->_d);
}  Constructor.
|    public mixed current()   | ||
| {return} | mixed | the current array item | 
 public function current()
{
    return $this->_d[$this->_i];
}  Returns the current array item. This method is required by the interface Iterator.
|    public integer key()   | ||
| {return} | integer | the key of the current array item | 
 public function key()
{
    return $this->_i;
}  Returns the key of the current array item. This method is required by the interface Iterator.
|    public void next()   | 
 public function next()
{
    $this->_i++;
}  Moves the internal pointer to the next array item. This method is required by the interface Iterator.
|    public void rewind()   | 
 public function rewind()
{
    $this->_i=0;
}  Rewinds internal array pointer. This method is required by the interface Iterator.
|    public boolean valid()   | ||
| {return} | boolean | |
 public function valid()
{
    return $this->_i<$this->_c;
}  Returns whether there is an item at current position. This method is required by the interface Iterator.
Signup or Login in order to comment.