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\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
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 anarray
with 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 anarray
with the values from the currentIterable