class DualIterator implements Iterator (View source)

The DualIterator class.

Constants

CURRENT_LHS

CURRENT_RHS

CURRENT_ARRAY

CURRENT_0

KEY_LHS

KEY_RHS

KEY_ARRAY

KEY_0

DEFAULT_FLAGS

Methods

__construct(Iterator $lhs, Iterator $rhs, int $flags = 51)

construct iterator from two iterators

getLHS()

Get lhs.

getRHS()

Get rhs.

void
setFlags(int $flags)

Set flags.

int
getFlags()

Get flag.

void
rewind()

Rewind both inner iterators

boolean
valid()

Is valid.

mixed
current()

Get current item.

mixed
key()

Get current key.

void
next()

Move both inner iterators forward

boolean
areIdentical()

Are Identical.

boolean
areEqual()

Are equal.

static boolean
compareIterators(Iterator $lhs, Iterator $rhs, boolean $identical = false)

Compare two iterators.

Details

at line line 60
__construct(Iterator $lhs, Iterator $rhs, int $flags = 51)

construct iterator from two iterators

Parameters

Iterator $lhs Left Hand Side Iterator
Iterator $rhs Right Hand Side Iterator
int $flags Iteration flags

at line line 72
Iterator getLHS()

Get lhs.

Return Value

Iterator Left Hand Side Iterator

at line line 82
Iterator getRHS()

Get rhs.

Return Value

Iterator Right Hand Side Iterator

at line line 94
void setFlags(int $flags)

Set flags.

Parameters

int $flags new flags

Return Value

void

at line line 104
int getFlags()

Get flag.

Return Value

int Current flags

at line line 114
void rewind()

Rewind both inner iterators

Return Value

void

at line line 125
boolean valid()

Is valid.

Return Value

boolean whether both inner iterators are valid

at line line 135
mixed current()

Get current item.

Return Value

mixed current value depending on CURRENT_* flags

at line line 156
mixed key()

Get current key.

Return Value

mixed current value depending on KEY_* flags

at line line 177
void next()

Move both inner iterators forward

Return Value

void

at line line 189
boolean areIdentical()

Are Identical.

Return Value

boolean Whether both inner iterators are valid and have identical current and key values or both are non valid.

at line line 203
boolean areEqual()

Are equal.

Return Value

boolean whether both inner iterators are valid and have equal current and key values or both are non valid.

at line line 223
static boolean compareIterators(Iterator $lhs, Iterator $rhs, boolean $identical = false)

Compare two iterators.

Parameters

Iterator $lhs Left Hand Side Iterator
Iterator $rhs Right Hand Side Iterator
boolean $identical Whether to use areEqual() or areIdentical()

Return Value

boolean whether both iterators are equal/identical