Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

HashIterator Class Reference

List of all members.

Public Member Functions

 HashIterator (&$hash)
 __construct (&$hash)
 reset ()
 isValid ()
next ()
 key ()
 index ()
value ()
 remove ()

Public Attributes

 $_src
 $_values
 $_keys
 $_key
 $_value
 $_i = -1
 $_end = false

Detailed Description

Hash iterator.

This kind of iterators are used to walk throug Hash objects.

Author:
Laurent Bedubourg <laurent.bedubourg@free.fr>

Definition at line 309 of file OHash.php.


Constructor & Destructor Documentation

HashIterator::HashIterator &$  hash  ) 
 

Iterator constructor.

Parameters:
mixed $hash -- OHash object or associative php array.

Definition at line 324 of file OHash.php.


Member Function Documentation

HashIterator::__construct &$  hash  ) 
 

Iterator php4.4 compliant constructor.

Parameters:
mixed $hash -- OHash object or associative php array.
Exceptions:
TypeError When $hash is not an array or an Hash object.

Definition at line 337 of file OHash.php.

References reset().

HashIterator::index  ) 
 

Return current index (position in iteration).

Returns:
int

Definition at line 423 of file OHash.php.

HashIterator::isValid  ) 
 

Test is end of iterator is not reached.

Definition at line 380 of file OHash.php.

HashIterator::key  ) 
 

Return current iterator key.

Returns:
string

Definition at line 413 of file OHash.php.

& HashIterator::next  ) 
 

Return next Hash item.

This method also set _key and _value.

Returns:
mixed (by reference) or false if end reached

Definition at line 392 of file OHash.php.

HashIterator::remove  ) 
 

Remove current iterated item from source.

Definition at line 445 of file OHash.php.

HashIterator::reset  ) 
 

Reset iterator to first element.

Definition at line 359 of file OHash.php.

Referenced by __construct().

& HashIterator::value  ) 
 

Return current iterator value.

Returns:
mixed

Definition at line 433 of file OHash.php.


Member Data Documentation

HashIterator::$_end = false
 

Definition at line 317 of file OHash.php.

HashIterator::$_i = -1
 

Definition at line 316 of file OHash.php.

HashIterator::$_key
 

Definition at line 314 of file OHash.php.

HashIterator::$_keys
 

Definition at line 313 of file OHash.php.

HashIterator::$_src
 

Definition at line 311 of file OHash.php.

HashIterator::$_value
 

Definition at line 315 of file OHash.php.

HashIterator::$_values
 

Definition at line 312 of file OHash.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 29 23:40:24 2004 for Mediawiki by doxygen 1.3.7