PHP Класс phpstreams\Collectors

For compatibility reasons, the returned collectors are actuall classes, rather than anonymous classes. This is an implementation detail, and should not be relied upon. The implementing classes may be removed at any point.
Автор: Bert Peters ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
averaging ( ) : phpstreams\Collector Collector that returns the average of the given elements.
joining ( string $delimiter = "" ) : phpstreams\Collector Get a collector that concatenates all the elements in the stream.
reducing ( mixed $identity, callable $reduction ) : phpstreams\Collector Get a collector that applies the given reduction to the stream.

Приватные методы

Метод Описание
__construct ( ) Hidden constructor, static class.

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

averaging() публичный статический Метод

The return type of this collector is float, regardless of the type of the stream elements.
public static averaging ( ) : phpstreams\Collector
Результат phpstreams\Collector

joining() публичный статический Метод

Get a collector that concatenates all the elements in the stream.
public static joining ( string $delimiter = "" ) : phpstreams\Collector
$delimiter string [optional] A delimiter to insert between elements. Defaults to the empty string.
Результат phpstreams\Collector

reducing() публичный статический Метод

Get a collector that applies the given reduction to the stream.
public static reducing ( mixed $identity, callable $reduction ) : phpstreams\Collector
$identity mixed
$reduction callable
Результат phpstreams\Collector