Usephul

Filler

Provides static methods that generate a filled ArrayObject.

Table of Contents

Methods

fill()  : static
Fill an ArrayObject with values.
fillKeys()  : static
Fill a Map with values, specifying keys.
range()  : static
Create a Map containing a range of elements.

Methods

fill()

Fill an ArrayObject with values.

public static fill(int $startIndex, int $count, V $value) : static

Fills a static with count entries of the value of the value parameter, keys starting at the startIndex parameter.

Parameters
$startIndex : int

The first index of the returned static.

$count : int
$value : V

Value to use for filling.

Return values
static

fillKeys()

Fill a Map with values, specifying keys.

public static fillKeys(iterable<string|int, K$keys, V $value) : static

Fills a ArrayMap with the value of the value parameter, using the values of the keys iterable as keys.

Parameters
$keys : iterable<string|int, K>

Iterable of values that will be used as keys. Illegal values for key will be converted to string.

$value : V

Value to use for filling.

Return values
static

range()

Create a Map containing a range of elements.

public static range(V $start, V $end[, int|float $step = 1 ]) : static

If both start and end are strings, and step is int the produced ArrayMap will be a sequence of bytes. Otherwise, the produced ArrayMap will be a sequence of numbers.

The sequence is increasing if start is less than equal to end. Otherwise, the sequence is decreasing.

Parameters
$start : V

First value of the sequence.

$end : V

Last possible value of the sequence.

$step : int|float = 1

step indicates by how much the produced sequence is progressed between values of the sequence.

step may be negative for decreasing sequences.

If step is a float without a fractional part, it is interpreted as int.

Return values
static

        
On this page

Search results