PHP Class CMapIterator, php_design_patterns

Позволяет экземпляру класса CMap возвращать новый итератор для обхода элементов карты.
Since: 1.0
Author: Qiang Xue ([email protected])
Inheritance: implements Iterator
Show file Open project: yunkaiyueming/php_design_patterns

Public Methods

Method Description
__construct ( &$data ) Constructor.
current ( ) : mixed Returns the current array element.
key ( ) : mixed Returns the key of the current array element.
next ( ) Moves the internal pointer to the next array element.
rewind ( ) Rewinds internal array pointer.
valid ( ) : boolean Returns whether there is an element at current position.

Method Details

__construct() public method

Constructor.
public __construct ( &$data )

current() public method

This method is required by the interface Iterator.
public current ( ) : mixed
return mixed the current array element

key() public method

This method is required by the interface Iterator.
public key ( ) : mixed
return mixed the key of the current array element

next() public method

This method is required by the interface Iterator.
public next ( )

rewind() public method

This method is required by the interface Iterator.
public rewind ( )

valid() public method

This method is required by the interface Iterator.
public valid ( ) : boolean
return boolean