ConstVector
Represents a read-only (immutable) sequence of values, indexed by integers (i.e., a vector)
Guides
Interface Synopsis
interface ConstVector implements ConstCollection<Tv>, ConstIndexAccess<int, Tv>, HH\Rx\KeyedIterable<int, Tv>, HH\KeyedContainer<int, Tv> {...}
Public Methods
->concat<Tu super Tv>(Traversable<Tu> $traversable): ConstVector<Tu>
Returns aConstVector
that is the concatenation of the values of the currentConstVector
and the values of the providedTraversable
->filter((function(Tv): bool) $fn): ConstVector<Tv>
Returns aConstVector
containing the values of the currentConstVector
that meet a supplied condition->filterWithKey((function(int, Tv): bool) $fn): ConstVector<Tv>
Returns aConstVector
containing the values of the currentConstVector
that meet a supplied condition applied to its keys and values->firstKey(): ?int
Returns the first key in the currentConstVector
->firstValue(): ?Tv
Returns the first value in the currentConstVector
->keys(): ConstVector<int>
Returns aConstVector
containing the keys of the currentConstVector
->lastKey(): ?int
Returns the last key in the currentConstVector
->lastValue(): ?Tv
Returns the last value in the currentConstVector
->linearSearch(mixed $search_value): int
Returns the index of the first element that matches the search value->map<Tu>((function(Tv): Tu) $fn): ConstVector<Tu>
Returns aConstVector
containing the values after an operation has been applied to each value in the currentConstVector
->mapWithKey<Tu>((function(int, Tv): Tu) $fn): ConstVector<Tu>
Returns aConstVector
containing the values after an operation has been applied to each key and value in the currentConstVector
->skip(int $n): ConstVector<Tv>
Returns aConstVector
containing the values after then
-th element of the currentConstVector
->skipWhile((function(Tv): bool) $fn): ConstVector<Tv>
Returns aConstVector
containing the values of the currentConstVector
starting after and including the first value that producestrue
when passed to the specified callback->slice(int $start, int $len): ConstVector<Tv>
Returns a subset of the currentConstVector
starting from a given key up to, but not including, the element at the provided length from the starting key->take(int $n): ConstVector<Tv>
Returns aConstVector
containing the firstn
values of the currentConstVector
->takeWhile((function(Tv): bool) $fn): ConstVector<Tv>
Returns aConstVector
containing the values of the currentConstVector
up to but not including the first value that producesfalse
when passed to the specified callback->toDArray(): darray<int, Tv>
->toVArray(): varray<Tv>
->values(): ConstVector<Tv>
Returns aConstVector
containing the values of the currentConstVector
->zip<Tu>(Traversable<Tu> $traversable): ConstVector<Pair<Tv, Tu>>
Returns aConstVector
where each element is aPair
that combines the element of the currentConstVector
and the providedTraversable