PHP Интерфейс Pinq\Iterators\IIteratorScheme

Автор: Elliot Levin ([email protected])
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
appendIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return all values from both the supplied iterators.
arrayCompatibleIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will map any non integer or string keys to incrementing integers.
arrayIterator ( array $array ) : Traversable Returns an iterator for the supplied array.
createOrderedMap ( Traversable $iterator = null ) : Pinq\Iterators\IOrderedMap Creates an ordered map from the supplied iterator.
createSet ( Traversable $iterator = null ) : Pinq\Iterators\ISet Creates an set from the supplied iterator values.
differenceIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return uniqe values present in the first but not the second iterator.
emptyIterator ( ) : Traversable Returns an empty iterator.
exceptIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return all values in the first but not present in the second iterator.
filterIterator ( Traversable $iterator, callable $predicate ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will filter the elements according to the supplied predicate function.
flattenedIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will iterate each element of the inner iterator's values. An exception will be thrown if an invalid iterator is returned from the supplied iterator.
groupJoinIterator ( Traversable $outerIterator, Traversable $innerIterator, callable $traversableFactory ) : Pinq\Iterators\IJoinIterator Returns an iterator which will return the outer elements joined to the inner elements. All matched inner elements for each outer element will be wrapped in a traversable implementation from the supplied factory.
groupedIterator ( Traversable $iterator, callable $groupKeyFunction, callable $traversableFactory ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will group the elements according to the supplied function and wrap each group in a traversable implementation from the supplied factory.
intersectionIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return unique values present in the first and second iterator.
joinIterator ( Traversable $outerIterator, Traversable $innerIterator ) : Pinq\Iterators\IJoinIterator Returns an iterator which will return the outer elements joined to the inner elements.
orderedIterator ( Traversable $iterator, callable $function, boolean $isAscending ) : Pinq\Iterators\IOrderedIterator Returns an iterator with will sort the elements according to the supplied function and direction.
projectionIterator ( Traversable $iterator, callable $keyProjectionFunction = null, callable $valueProjectionFunction = null ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return the elements mapped by the supplied functions or the original if no function is supplied.
rangeIterator ( Traversable $iterator, integer $start, integer | null $amount ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will only iterate the elements in the supplied range.
reindexerIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return the map the keys to 0-based incrementing integers
toArray ( Traversable $iterator ) : array Safely converts the supplied iterator to an array.
toIterator ( Traversable | array $traversableOrArray ) : Traversable Returns the supplied traversable or array as an iterator compatible with this scheme.
unionIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return unique values present in the first or second iterator.
uniqueIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return unique values using strict equality.
uniqueKeyIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return only the first associated value for any key.
walk ( Traversable $iterator, callable $function ) : void Iterate over the keys and values of the supplied iterator and passes them (value, key) to the supplied function.
whereInIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator Returns an iterator which will return all values in the first iterator present in the second.

Описание методов

appendIterator() публичный метод

Returns an iterator which will return all values from both the supplied iterators.
public appendIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$otherIterator Traversable
Результат Pinq\Iterators\IWrapperIterator

arrayCompatibleIterator() публичный метод

Returns an iterator which will map any non integer or string keys to incrementing integers.
public arrayCompatibleIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
Результат Pinq\Iterators\IWrapperIterator

arrayIterator() публичный метод

Returns an iterator for the supplied array.
public arrayIterator ( array $array ) : Traversable
$array array
Результат Traversable

createOrderedMap() публичный метод

Keys can only be associated with a single value and such if the iterator returns duplicate keys the last respective value will be used.
public createOrderedMap ( Traversable $iterator = null ) : Pinq\Iterators\IOrderedMap
$iterator Traversable
Результат Pinq\Iterators\IOrderedMap

createSet() публичный метод

A set can only contain unique values and such duplicates will be lost.
public createSet ( Traversable $iterator = null ) : Pinq\Iterators\ISet
$iterator Traversable
Результат Pinq\Iterators\ISet

differenceIterator() публичный метод

Returns an iterator which will return uniqe values present in the first but not the second iterator.
public differenceIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$otherIterator Traversable
Результат Pinq\Iterators\IWrapperIterator

emptyIterator() публичный метод

Returns an empty iterator.
public emptyIterator ( ) : Traversable
Результат Traversable

exceptIterator() публичный метод

Returns an iterator which will return all values in the first but not present in the second iterator.
public exceptIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$otherIterator Traversable
Результат Pinq\Iterators\IWrapperIterator

filterIterator() публичный метод

Returns an iterator which will filter the elements according to the supplied predicate function.
public filterIterator ( Traversable $iterator, callable $predicate ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$predicate callable
Результат Pinq\Iterators\IWrapperIterator

flattenedIterator() публичный метод

Returns an iterator which will iterate each element of the inner iterator's values. An exception will be thrown if an invalid iterator is returned from the supplied iterator.
public flattenedIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
Результат Pinq\Iterators\IWrapperIterator

groupJoinIterator() публичный метод

Returns an iterator which will return the outer elements joined to the inner elements. All matched inner elements for each outer element will be wrapped in a traversable implementation from the supplied factory.
public groupJoinIterator ( Traversable $outerIterator, Traversable $innerIterator, callable $traversableFactory ) : Pinq\Iterators\IJoinIterator
$outerIterator Traversable
$innerIterator Traversable
$traversableFactory callable
Результат Pinq\Iterators\IJoinIterator

groupedIterator() публичный метод

Returns an iterator which will group the elements according to the supplied function and wrap each group in a traversable implementation from the supplied factory.
public groupedIterator ( Traversable $iterator, callable $groupKeyFunction, callable $traversableFactory ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$groupKeyFunction callable
$traversableFactory callable
Результат Pinq\Iterators\IWrapperIterator

intersectionIterator() публичный метод

Returns an iterator which will return unique values present in the first and second iterator.
public intersectionIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$otherIterator Traversable
Результат Pinq\Iterators\IWrapperIterator

joinIterator() публичный метод

Returns an iterator which will return the outer elements joined to the inner elements.
public joinIterator ( Traversable $outerIterator, Traversable $innerIterator ) : Pinq\Iterators\IJoinIterator
$outerIterator Traversable
$innerIterator Traversable
Результат Pinq\Iterators\IJoinIterator

orderedIterator() публичный метод

Returns an iterator with will sort the elements according to the supplied function and direction.
public orderedIterator ( Traversable $iterator, callable $function, boolean $isAscending ) : Pinq\Iterators\IOrderedIterator
$iterator Traversable
$function callable
$isAscending boolean
Результат Pinq\Iterators\IOrderedIterator

projectionIterator() публичный метод

Returns an iterator which will return the elements mapped by the supplied functions or the original if no function is supplied.
public projectionIterator ( Traversable $iterator, callable $keyProjectionFunction = null, callable $valueProjectionFunction = null ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$keyProjectionFunction callable
$valueProjectionFunction callable
Результат Pinq\Iterators\IWrapperIterator

rangeIterator() публичный метод

Returns an iterator which will only iterate the elements in the supplied range.
public rangeIterator ( Traversable $iterator, integer $start, integer | null $amount ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$start integer
$amount integer | null
Результат Pinq\Iterators\IWrapperIterator

reindexerIterator() публичный метод

Returns an iterator which will return the map the keys to 0-based incrementing integers
public reindexerIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
Результат Pinq\Iterators\IWrapperIterator

toArray() публичный метод

Non integer or string keys will be reindexed to respective incremented integers.
public toArray ( Traversable $iterator ) : array
$iterator Traversable
Результат array

toIterator() публичный метод

Returns the supplied traversable or array as an iterator compatible with this scheme.
public toIterator ( Traversable | array $traversableOrArray ) : Traversable
$traversableOrArray Traversable | array
Результат Traversable

unionIterator() публичный метод

Returns an iterator which will return unique values present in the first or second iterator.
public unionIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$otherIterator Traversable
Результат Pinq\Iterators\IWrapperIterator

uniqueIterator() публичный метод

Returns an iterator which will return unique values using strict equality.
public uniqueIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
Результат Pinq\Iterators\IWrapperIterator

uniqueKeyIterator() публичный метод

Returns an iterator which will return only the first associated value for any key.
public uniqueKeyIterator ( Traversable $iterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
Результат Pinq\Iterators\IWrapperIterator

walk() публичный метод

Iterate over the keys and values of the supplied iterator and passes them (value, key) to the supplied function.
public walk ( Traversable $iterator, callable $function ) : void
$iterator Traversable
$function callable
Результат void

whereInIterator() публичный метод

Returns an iterator which will return all values in the first iterator present in the second.
public whereInIterator ( Traversable $iterator, Traversable $otherIterator ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$otherIterator Traversable
Результат Pinq\Iterators\IWrapperIterator