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

Iterator Class Reference

Inheritance diagram for Iterator:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 reset ()
 isValid ()
next ()
 index ()
value ()
 key ()
 remove ()

Detailed Description

Iterator interface.

This class provides common methods for Iterator objects.

An iterator is a 'pointer' to a data item extracted from some collection of resources.

The aim of Iterator is to allow some abstraction between your program resources and the way you fetch these resources.

Thus, you can loop over a file content and later replace this file with a database backend whithout changing the program logic.

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

Definition at line 60 of file Iterator.php.


Member Function Documentation

Iterator::index  ) 
 

Retrieve the current item index.

Returns:
int

Reimplemented in PHPTAL_DBResultIterator, and ArrayIterator.

Definition at line 103 of file Iterator.php.

Referenced by key().

Iterator::isValid  ) 
 

Test if current item is not the end of iterator.

Returns:
boolean

Reimplemented in PHPTAL_DBResultIterator, and ArrayIterator.

Definition at line 79 of file Iterator.php.

Iterator::key  ) 
 

(optional) Additional index for hashes.

Returns:
string

Definition at line 127 of file Iterator.php.

References index().

& Iterator::next  ) 
 

Iterate on the next element and returns the next item.

Returns:
mixed (by reference)

Reimplemented in PHPTAL_DBResultIterator, and ArrayIterator.

Definition at line 89 of file Iterator.php.

Iterator::remove  ) 
 

(optional) Remove the current value from container.

Implement this method only when the iterator can do a secured remove without breaking other iterators works.

Reimplemented in ArrayIterator.

Definition at line 138 of file Iterator.php.

Iterator::reset  ) 
 

Reset iterator to first item.

This method should throw an exception for once only iterators.

Exceptions:
ResetFailed 

Reimplemented in PHPTAL_DBResultIterator, and ArrayIterator.

Definition at line 69 of file Iterator.php.

& Iterator::value  ) 
 

Retrieve current item value.

Returns:
mixed (by reference)

Reimplemented in PHPTAL_DBResultIterator, and ArrayIterator.

Definition at line 113 of file Iterator.php.


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