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