Extended Iterator interfaces

SeekableIterator interface

SeekableIterator iterface extends Iterator and adds the seek($position), to allow repositioning of the iterator to anywhere within its start position to one past its end position.

SeekableIterator extends Iterator {
    /* Methods */
    abstract public void seek ( int $position )
    /* Inherited methods */
    abstract public mixed Iterator::current ( void )
    abstract public scalar Iterator::key ( void )
    abstract public void Iterator::next ( void )
    abstract public void Iterator::rewind ( void )
    abstract public boolean Iterator::valid ( void )
}

Countable interface

Implementing the Countable interface and providing a count() method allows your objects to be passed to \count($collection);.

Countable {

    /* Methods */
    abstract public int count ( void )
}