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 aConstVectorthat is the concatenation of the values of the currentConstSetand the values of the providedTraversable->filter((function(Tv): bool) $fn): ConstSet<Tv>
Returns aConstSetcontaining the values of the currentConstSetthat meet a supplied condition applied to each value->filterWithKey((function(arraykey, Tv): bool) $fn): ConstSet<Tv>
Returns aConstSetcontaining the values of the currentConstSetthat 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 aConstVectorcontaining 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 aConstSetcontaining 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 aConstSetcontaining the values after an operation has been applied to each "key" and value in the current Set->skip(int $n): ConstSet<Tv>
Returns aConstSetcontaining the values after then-th element of the currentConstSet->skipWhile((function(Tv): bool) $fn): ConstSet<Tv>
Returns aConstSetcontaining the values of the currentConstSetstarting after and including the first value that producestruewhen passed to the specified callback->slice(int $start, int $len): ConstSet<Tv>
Returns a subset of the currentConstSetstarting 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 aConstSetcontaining the firstnvalues of the currentConstSet->takeWhile((function(Tv): bool) $fn): ConstSet<Tv>
Returns aConstSetcontaining the values of the currentConstSetup to but not including the first value that producesfalsewhen passed to the specified callback->toDArray(): darray<Tv, Tv>->toVArray(): varray<Tv>->values(): ConstVector<Tv>
Returns aConstVectorcontaining the values of the currentConstSet->zip<Tu>(Traversable<Tu> $traversable): ConstSet<nothing>
Returns aConstSetwhere each value is aPairthat combines the value of the currentConstSetand 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