Documentation

Lookahead extends IteratorIterator
in package
implements Outer

Class \Hoa\Iterator\Lookahead.

Look ahead iterator.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Interfaces

Outer
Interface \Hoa\Iterator\Outer.

Properties

$_current  : mixed
Current value.
$_iterator  : Iterator
Current iterator.
$_key  : mixed
Current key.
$_valid  : bool
Whether the current element is valid or not.

Methods

__construct()  : mixed
Construct.
current()  : mixed
Return the current element.
getInnerIterator()  : Iterator
Get inner iterator.
getNext()  : mixed
Get next value.
getNextKey()  : mixed
Get next key.
hasNext()  : bool
Check whether there is a next element.
key()  : mixed
Return the key of the current element.
next()  : void
Move forward to next element.
rewind()  : void
Rewind the iterator to the first element.
valid()  : bool
Check if current position is valid.

Properties

$_current

Current value.

protected mixed $_current = null

$_iterator

Current iterator.

protected Iterator $_iterator = null

$_key

Current key.

protected mixed $_key = 0

$_valid

Whether the current element is valid or not.

protected bool $_valid = false

Methods

__construct()

Construct.

public __construct(Iterator $iterator) : mixed
Parameters
$iterator : Iterator

Iterator.

current()

Return the current element.

public current() : mixed

getInnerIterator()

Get inner iterator.

public getInnerIterator() : Iterator
Return values
Iterator

getNext()

Get next value.

public getNext() : mixed

getNextKey()

Get next key.

public getNextKey() : mixed

hasNext()

Check whether there is a next element.

public hasNext() : bool
Return values
bool

key()

Return the key of the current element.

public key() : mixed

next()

Move forward to next element.

public next() : void

rewind()

Rewind the iterator to the first element.

public rewind() : void

valid()

Check if current position is valid.

public valid() : bool
Return values
bool

        
On this page

Search results