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