MutableMap
Represents a write-enabled (mutable) sequence of key/value pairs (i.e. a map)
Guides
Interface Synopsis
interface MutableMap implements ConstMap<Tk, Tv>, HH\Collection<Pair<Tk, Tv>>, MapAccess<Tk, Tv> {...}
Public Methods
->concat<Tu super Tv>(Traversable<Tu> $traversable): MutableVector<Tu>
Returns aMutableVector
that is the concatenation of the values of the currentMutableMap
and the values of the providedTraversable
->filter((function(Tv): bool) $fn): MutableMap<Tk, Tv>
Returns aMutableMap
containing the values of the currentMutableMap
that meet a supplied condition->filterWithKey((function(Tk, Tv): bool) $fn): MutableMap<Tk, Tv>
Returns aMutableMap
containing the values of the currentMutableMap
that meet a supplied condition applied to its keys and values->firstKey(): ?Tk
Returns the first key in the currentMutableMap
->firstValue(): ?Tv
Returns the first value in the currentMutableMap
->keys(): MutableVector<Tk>
Returns aMutableVector
containing the keys of the currentMutableMap
->lastKey(): ?Tk
Returns the last key in the currentMutableMap
->lastValue(): ?Tv
Returns the last value in the currentMutableMap
->map<Tu>((function(Tv): Tu) $fn): MutableMap<Tk, Tu>
Returns aMutableMap
after an operation has been applied to each value in the currentMutableMap
->mapWithKey<Tu>((function(Tk, Tv): Tu) $fn): MutableMap<Tk, Tu>
Returns aMutableMap
after an operation has been applied to each key and value in the currentMutableMap
->skip(int $n): MutableMap<Tk, Tv>
Returns aMutableMap
containing the values after then
-th element of the currentMutableMap
->skipWhile((function(Tv): bool) $fn): MutableMap<Tk, Tv>
Returns aMutableMap
containing the values of the currentMutableMap
starting after and including the first value that producestrue
when passed to the specified callback->slice(int $start, int $len): MutableMap<Tk, Tv>
Returns a subset of the currentMutableMap
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): MutableMap<Tk, Tv>
Returns aMutableMap
containing the firstn
key/values of the currentMutableMap
->takeWhile((function(Tv): bool) $fn): MutableMap<Tk, Tv>
Returns aMutableMap
containing the keys and values of the currentMutableMap
up to but not including the first value that producesfalse
when passed to the specified callback->toDArray(): darray<Tk, Tv>
->toVArray(): varray<Tv>
->values(): MutableVector<Tv>
Returns aMutableVector
containing the values of the currentMutableMap
->zip<Tu>(Traversable<Tu> $traversable): MutableMap<Tk, Pair<Tv, Tu>>
Returns aMutableMap
where each value is aPair
that combines the value of the currentMutableMap
and the providedTraversable