Class Xyster_Collection_Iterator

Description

Implements interfaces:

  • SeekableIterator (internal interface)
  • Countable (internal interface)

Iterator for collections

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Collection/Iterator.php (line 23)


	
			
Variable Summary
array $_items
Method Summary
Xyster_Collection_Iterator __construct ( $list)
int count ()
mixed current ()
mixed key ()
void next ()
void rewind ()
void seek (int $index)
boolean valid ()
Variables
array $_items (line 30)

The array over which to iterate

  • access: protected
Methods
Constructor __construct (line 37)

Creates a new iterator

  • access: public
Xyster_Collection_Iterator __construct ( $list)
  • array $list: An array to iterate
count (line 47)

Counts the number of elements

  • return: Number of elements in collection
  • access: public
int count ()

Implementation of:
Countable::count
current (line 57)

Return the current element

  • return: The current element
  • access: public
mixed current ()

Implementation of:
SeekableIterator::current
key (line 67)

Return the key of the current element

  • return: Key of the current element
  • access: public
mixed key ()

Implementation of:
SeekableIterator::key
next (line 76)

Move pointer forward to next element

  • access: public
void next ()

Implementation of:
SeekableIterator::next
rewind (line 85)

Rewind the pointer to the first element

  • access: public
void rewind ()

Implementation of:
SeekableIterator::rewind
seek (line 106)

Seek to an absolute position.

  • throws: Xyster_Collection_Exception if the seek position is not found
  • access: public
void seek (int $index)
  • int $index: Position to seek

Implementation of:
SeekableIterator::seek
valid (line 95)

Check if there is a current element after calls to rewind() or next()

  • access: public
boolean valid ()

Implementation of:
SeekableIterator::valid

Documentation generated on Mon, 19 May 2008 17:07:24 -0400 by phpDocumentor 1.4.2