PHP 인터페이스 Pinq\Iterators\IIteratorScheme

저자: Elliot Levin ([email protected])
파일 보기 프로젝트 열기: timetoogo/pinq 0 사용 예제들

공개 메소드들

메소드 설명
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