HH\KeyedIterable
Represents any entity that can be iterated over using something like
foreach
The entity is required to have a key in addition to values.
KeyedIterable does not include arrays.
Guides
Interface Synopsis
namespace HH;
interface KeyedIterable implements Iterable<Tv>, KeyedTraversable<Tk, Tv> {...}
Public Methods
->concat<Tu super Tv>(Traversable<Tu> $traversable): Iterable<Tu>
Returns anIterablethat is the concatenation of the values of the currentKeyedIterableand the values of the providedTraversable->filter((function(Tv): bool) $fn): KeyedIterable<Tk, Tv>
Returns aKeyedIterablecontaining the values of the currentKeyedIterablethat meet a supplied condition->filterWithKey((function(Tk, Tv): bool) $callback): KeyedIterable<Tk, Tv>
Returns aKeyedIterablecontaining the values of the currentKeyedIterablethat meet a supplied condition applied to its keys and values->firstKey(): ?Tk
Returns the first key in the currentKeyedIterable->firstValue(): ?Tv
Returns the first value in the currentKeyedIterable->getIterator(): KeyedIterator<Tk, Tv>
Returns an iterator that points to beginning of the currentKeyedIterable->keys(): Iterable<Tk>
Returns anIterablecontaining the currentKeyedIterable's keys->lastKey(): ?Tk
Returns the last key in the currentKeyedIterable->lastValue(): ?Tv
Returns the last value in the currentKeyedIterable->lazy(): KeyedIterable<Tk, Tv>
Returns a lazy, access elements only when needed view of the currentKeyedIterable->map<Tu>((function(Tv): Tu) $fn): KeyedIterable<Tk, Tu>
Returns aKeyedIterablecontaining the values after an operation has been applied to each value in the currentKeyedIterable->mapWithKey<Tu>((function(Tk, Tv): Tu) $callback): KeyedIterable<Tk, Tu>
Returns aKeyedIterablecontaining the values after an operation has been applied to each key and value in the currentKeyedIterable->skip(int $n): KeyedIterable<Tk, Tv>
Returns aKeyedIterablecontaining the values after then-th element of the currentKeyedIterable->skipWhile((function(Tv): bool) $fn): KeyedIterable<Tk, Tv>
Returns aKeyedIterablecontaining the values of the currentKeyedIterablestarting after and including the first value that producestruewhen passed to the specified callback->slice(int $start, int $len): KeyedIterable<Tk, Tv>
Returns a subset of the currentKeyedIterablestarting from a given key up to, but not including, the element at the provided length from the starting key->take(int $n): KeyedIterable<Tk, Tv>
Returns aKeyedIterablecontaining the firstnvalues of the currentKeyedIterable->takeWhile((function(Tv): bool) $fn): KeyedIterable<Tk, Tv>
Returns aKeyedIterablecontaining the values of the currentKeyedIterableup to but not including the first value that producesfalsewhen passed to the specified callback->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->values(): Iterable<Tv>
Returns anIterablecontaining the currentKeyedIterable's values->zip<Tu>(Traversable<Tu> $traversable): KeyedIterable<Tk, Pair<Tv, Tu>>
Returns aKeyedIterablewhere each element is aPairthat combines the element of the currentKeyedIterableand the providedTraversable
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