MutableSet
Represents a write-enabled (mutable) set of values, not indexed by keys (i.e. a set)
Guides
Interface Synopsis
interface MutableSet implements ConstSet<Tv>, HH\Collection<Tv>, SetAccess<Tv> {...}
Public Methods
->concat<Tu super Tv>(Traversable<Tu> $traversable): MutableVector<Tu>
Returns aMutableVectorthat is the concatenation of the values of the currentMutableSetand the values of the providedTraversable->filter((function(Tv): bool) $fn): MutableSet<Tv>
Returns aMutableSetcontaining the values of the currentMutableSetthat meet a supplied condition applied to each value->filterWithKey((function(arraykey, Tv): bool) $fn): MutableSet<Tv>
Returns aMutableSetcontaining the values of the currentMutableSetthat meet a supplied condition applied to its "keys" and values->firstKey(): ?arraykey
Returns the first "key" in the currentMutableSet->firstValue(): ?Tv
Returns the first value in the currentMutableSet->keys(): MutableVector<arraykey>
Returns aMutableVectorcontaining the values of the currentMutableSet->lastKey(): ?arraykey
Returns the last "key" in the currentMutableSet->lastValue(): ?Tv
Returns the last value in the currentMutableSet->map<Tu as arraykey>((function(Tv): Tu) $fn): MutableSet<Tu>
Returns aMutableSetcontaining the values after an operation has been applied to each value in the currentMutableSet->mapWithKey<Tu as arraykey>((function(arraykey, Tv): Tu) $fn): MutableSet<Tu>
Returns aMutableSetcontaining the values after an operation has been applied to each "key" and value in the current Set->skip(int $n): MutableSet<Tv>
Returns aMutableSetcontaining the values after then-th element of the currentMutableSet->skipWhile((function(Tv): bool) $fn): MutableSet<Tv>
Returns aMutableSetcontaining the values of the currentMutableSetstarting after and including the first value that producestruewhen passed to the specified callback->slice(int $start, int $len): MutableSet<Tv>
Returns a subset of the currentMutableSetstarting from a given key up to, but not including, the element at the provided length from the starting key->take(int $n): MutableSet<Tv>
Returns aMutableSetcontaining the firstnvalues of the currentMutableSet->takeWhile((function(Tv): bool) $fn): MutableSet<Tv>
Returns aMutableSetcontaining the values of the currentMutableSetup to but not including the first value that producesfalsewhen passed to the specified callback->toDArray(): darray<Tv, Tv>->toVArray(): varray<Tv>->values(): MutableVector<Tv>
Returns aMutableVectorcontaining the values of the currentMutableSet->zip<Tu>(Traversable<Tu> $traversable): MutableSet<nothing>
Returns aMutableSetwhere each value is aPairthat combines the value of the currentMutableSetand the providedTraversable
Public Methods (ConstCollection)
-
->count(): int
Get the number of items in the collection -
->isEmpty(): bool
Is the collection empty? -
->items(): HH\Iterable<Te>
Get access to the items in the collection
Public Methods (IPureStringishObject)
Public Methods (ConstSetAccess)
->contains(arraykey $m): bool
Checks whether a value is in the currentSet
Public Methods (HH\KeyedIterable)
->getIterator(): KeyedIterator<Tk, Tv>
Returns an iterator that points to beginning of the currentKeyedIterable->lazy(): KeyedIterable<Tk, Tv>
Returns a lazy, access elements only when needed view of the currentKeyedIterable->toImmMap(): ImmMap<Tk, Tv>
Returns an immutable map (ImmMap) based on the keys and values of the currentKeyedIterable->toKeysArray(): varray
Returns anarraywith the keys from the currentKeyedIterable
Public Methods (HH\Iterable)
->toImmSet(): ImmSet<Tv>
Returns an immutable set (ImmSet) converted from the currentIterable->toImmVector(): ImmVector<Tv>
Returns an immutable vector (ImmVector) converted from the currentIterable->toValuesArray(): varray<Tv>
Returns anarraywith the values from the currentIterable
Public Methods (HH\Collection)
->clear()
Removes all items from the collection
Public Methods (OutputCollection)
->add(Te $e): this
Add a value to the collection and return the collection itself->addAll(?Traversable<Te> $traversable): this
For every element in the providedTraversable, append a value into the current collection
Public Methods (SetAccess)
->remove(Tm $m): this
Removes the provided value from the currentSet