MaybeMutable the collection builtins
[hiphop-php.git] / hphp / runtime / ext / collections / ext_collections-vector.php
blob14876a19ca3f443c2e0764cce679472c35c662d9
1 <?hh
3 namespace {
5 /* An iterator implementation for iterating over a Vector/ImmVector.
6 */
7 <<__NativeData("VectorIterator")>>
8 final class VectorIterator implements HH\Rx\KeyedIterator {
10 /* Do nothing */
11 <<__Rx>>
12 public function __construct(): void { }
14 /* Returns the current value that the iterator points to.
15 * @return mixed
17 <<__Native, __Rx, __MaybeMutable>>
18 public function current(): mixed;
20 /* Returns the current key that the iterator points to.
21 * @return mixed
23 <<__Native, __Rx, __MaybeMutable>>
24 public function key(): mixed;
26 /* Returns true if the iterator points to a valid value, returns false
27 * otherwise.
28 * @return bool
30 <<__Native, __Rx, __MaybeMutable>>
31 public function valid(): bool;
33 /* Advance this iterator forward one position.
35 <<__Native, __Rx, __Mutable>>
36 public function next(): void;
38 /* Move this iterator back to the first position.
40 <<__Native, __Rx, __Mutable>>
41 public function rewind(): void;
44 } // empty namespace
45 namespace HH {
47 /* An ordered collection where values are keyed using integers 0 thru n-1 in
48 * order.
50 final class Vector implements \MutableVector {
52 /* Returns a Vector built from the values produced by the specified Iterable.
53 * @param mixed $iterable
55 <<__Native, __Rx, __OnlyRxIfArgs>>
56 public function __construct(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable = null): void;
58 /* Returns true if the Vector is empty, false otherwise.
59 * @return bool
61 <<__Rx, __MaybeMutable>>
62 public function isEmpty(): bool {
63 return !$this->count();
66 /* Returns the number of values in the Vector.
67 * @return int
69 <<__Native, __Rx, __MaybeMutable>>
70 public function count(): int;
72 /* Returns an Iterable that produces the values from this Vector.
73 * @return object
75 <<__Rx, __MutableReturn, __MaybeMutable>>
76 public function items(): \LazyIterableView {
77 return new \LazyIterableView($this);
80 /* Returns a Vector built from the keys of this Vector.
81 * @return object
83 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
84 public function keys(): object;
86 /* Returns a clone of this Vector.
87 * @return object
89 <<__Rx, __MutableReturn, __MaybeMutable>>
90 public function values(): this {
91 return clone $this;
94 /* Returns a lazy iterable view of this Vector.
95 * @return object
97 <<__Rx, __MutableReturn, __MaybeMutable>>
98 public function lazy(): \LazyKeyedIterableView {
99 return new \LazyKeyedIterableView($this);
102 /* Returns the value at the specified key. If the key is not present, an
103 * exception is thrown.
104 * @param mixed $key
105 * @return mixed
107 <<__Native, __Rx, __MaybeMutable>>
108 public function at(mixed $key): mixed;
110 /* Returns the value at the specified key. If the key is not present, null is
111 * returned.
112 * @param mixed $key
113 * @return mixed
115 <<__Native, __Rx, __MaybeMutable>>
116 public function get(mixed $key): mixed;
118 /* Stores a value into the Vector with the specified key, overwriting any
119 * previous value that was associated with the key; if the key is outside the
120 * bounds of the Vector, an exception is thrown.
121 * @param mixed $key
122 * @param mixed $value
123 * @return object
125 <<__Native, __Rx, __Mutable, __ReturnsVoidToRx>>
126 public function set(mixed $key,
127 mixed $value): object;
129 /* Stores each value produced by the specified KeyedIterable into the Vector
130 * using its corresponding key, overwriting any previous value that was
131 * associated with that key; if the key is outside the bounds of the Vector,
132 * an exception is thrown.
133 * @param mixed $iterable
134 * @return object
136 <<__Native, __Rx, __Mutable, __OnlyRxIfArgs, __ReturnsVoidToRx>>
137 public function setAll(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\KeyedTraversable::class)>> mixed $iterable): object;
139 /* Removes all values from the Vector.
140 * @return object
142 <<__Native, __Rx, __Mutable, __ReturnsVoidToRx>>
143 public function clear(): object;
145 /* Returns true if the specified key is present in the Vector, returns false
146 * otherwise.
147 * @param mixed $key
148 * @return bool
150 <<__Deprecated(
151 "Use Vector::containsKey() for key search or Vector::linearSearch() for value search"
153 public function contains(mixed $key): bool {
154 if (!\is_int($key)) {
155 throw new \InvalidArgumentException(
156 "Only integer keys may be used with Vectors"
159 return ($key >= 0) && ($key < $this->count());
162 /* Returns true if the specified key is present in the Vector, returns false
163 * otherwise.
164 * @param mixed $key
165 * @return bool
167 <<__Rx, __MaybeMutable>>
168 public function containsKey(mixed $key): bool {
169 if (!\is_int($key)) {
170 throw new \InvalidArgumentException(
171 "Only integer keys may be used with Vectors"
174 return ($key >= 0) && ($key < $this->count());
177 /* Removes the element with the specified key from this Vector and renumbers
178 * the keys of all subsequent elements.
179 * @param mixed $key
180 * @return object
182 <<__Native, __Rx, __Mutable, __ReturnsVoidToRx>>
183 public function removeKey(mixed $key): object;
185 /* @param mixed $val
186 * @return object
188 <<__Native>>
189 public function append(mixed $val): object;
191 /* Adds the specified value to the end of this Vector using the next available
192 * integer key.
193 * @param mixed $val
194 * @return object
196 <<__Native, __Rx, __Mutable, __ReturnsVoidToRx>>
197 public function add(mixed $val): object;
199 /* Adds the values produced by the specified Iterable to the end of this
200 * Vector using the next available integer keys.
201 * @param mixed $iterable
202 * @return object
204 <<__Native, __Rx, __Mutable, __OnlyRxIfArgs, __ReturnsVoidToRx>>
205 public function addAll(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
207 /* Adds the keys of the specified KeyedContainer to the end of this Vector
208 * using the next available integer keys.
209 * @param mixed $container
210 * @return object
212 <<__Native, __Rx, __Mutable, __ReturnsVoidToRx>>
213 public function addAllKeysOf(mixed $container): object;
215 /* @return mixed
217 <<__Native, __Rx, __Mutable>>
218 public function pop(): mixed;
220 /* @param mixed $sz
221 * @param mixed $value
223 <<__Native, __Rx, __Mutable>>
224 public function resize(mixed $sz,
225 mixed $value): void;
227 /* Instructs this Vector to grow its capacity to accommodate the given number
228 * of elements. The caller is expected to make the appropriate add/addAll
229 * calls to fill that reserved capacity.
230 * @param mixed $sz
232 <<__Native, __Rx, __Mutable>>
233 public function reserve(mixed $sz): void;
235 /* Returns an array built from the values from this Vector.
236 * @return array
238 <<__Native, __Rx, __MaybeMutable>>
239 public function toArray(): array;
241 <<__Native, __Rx, __MaybeMutable>>
242 public function toVArray(): varray;
244 <<__Native, __Rx, __MaybeMutable>>
245 public function toDArray(): darray;
247 /* Returns a copy of this Vector.
248 * @return object
250 <<__Rx, __MutableReturn, __MaybeMutable>>
251 public function toVector(): this {
252 return clone $this;
255 /* Returns a ImmVector built from the values of this Vector.
256 * @return object
258 <<__Native, __Rx, __MaybeMutable>>
259 public function toImmVector(): object;
261 /* Returns an immutable version of this collection.
262 * @return object
264 <<__Rx, __MaybeMutable>>
265 public function immutable(): \HH\ImmVector {
266 return $this->toImmVector();
269 /* Returns a Map built from the keys and values of this Vector.
270 * @return object
272 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
273 public function toMap(): object;
275 /* Returns a ImmMap built from the keys and values of this Vector.
276 * @return object
278 <<__Native, __Rx, __MaybeMutable>>
279 public function toImmMap(): object;
281 /* Returns a Set built from the values of this Vector.
282 * @return object
284 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
285 public function toSet(): object;
287 /* Returns a ImmSet built from the values of this Vector.
288 * @return object
290 <<__Native, __Rx, __MaybeMutable>>
291 public function toImmSet(): object;
293 /* Returns an array built from the keys from this Vector.
294 * @return array
296 <<__Rx, __MaybeMutable>>
297 public function toKeysArray(): array {
298 $count = $this->count();
299 return $count ? range(0, $count - 1) : array();
302 /* Returns an array built from the values from this Vector.
303 * @return array
305 <<__Rx, __MaybeMutable>>
306 public function toValuesArray(): array {
307 return $this->toArray();
310 /* Returns an iterator that points to beginning of this Vector.
311 * @return object
313 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
314 public function getIterator(): object;
316 /* Returns a Vector of the values produced by applying the specified callback
317 * on each value from this Vector.
318 * @param mixed $callback
319 * @return object
321 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
322 public function map(<<__OnlyRxIfRxFunc>> mixed $callback): object;
324 /* Returns a Vector of the values produced by applying the specified callback
325 * on each key and value from this Vector.
326 * @param mixed $callback
327 * @return object
329 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
330 public function mapWithKey(<<__OnlyRxIfRxFunc>> mixed $callback): object;
332 /* Returns a Vector of all the values from this Vector for which the specified
333 * callback returns true.
334 * @param mixed $callback
335 * @return object
337 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
338 public function filter(<<__OnlyRxIfRxFunc>> mixed $callback): object;
340 /* Returns a Vector of all the values from this Vector for which the specified
341 * callback returns true.
342 * @param mixed $callback
343 * @return object
345 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
346 public function filterWithKey(<<__OnlyRxIfRxFunc>> mixed $callback): object;
348 /* Returns a KeyedIterable produced by combined the specified Iterables
349 * pair-wise.
350 * @param mixed $iterable
351 * @return object
353 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
354 public function zip(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
356 /* Returns a Vector containing the first n values of this Vector.
357 * @param mixed $n
358 * @return object
360 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
361 public function take(mixed $n): object;
363 /* Returns a Vector containing the values of this Vector up to but not
364 * including the first value that produces false when passed to the specified
365 * callback.
366 * @param mixed $callback
367 * @return object
369 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
370 public function takeWhile(<<__OnlyRxIfRxFunc>> mixed $callback): object;
372 /* Returns a Vector containing all the values except the first n of this
373 * Vector.
374 * @param mixed $n
375 * @return object
377 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
378 public function skip(mixed $n): object;
380 /* Returns a Vector containing the values of this Vector excluding the first
381 * values that produces true when passed to the specified callback.
382 * @param mixed $fn
383 * @return object
385 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
386 public function skipWhile(<<__OnlyRxIfRxFunc>> mixed $fn): object;
388 /* Returns a Vector containing the specified range of values from this Vector.
389 * The range is specified by two non-negative integers: a starting position
390 * and a length.
391 * @param mixed $start
392 * @param mixed $len
393 * @return object
395 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
396 public function slice(mixed $start,
397 mixed $len): object;
399 /* Builds a new Vector by concatenating the elements of this Vector with the
400 * elements of the specified Iterable.
401 * @param mixed $iterable
402 * @return object
404 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
405 public function concat(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
407 /* Returns the first value from this Vector, or null if this Vector is empty.
408 * @return mixed
410 <<__Native, __Rx, __MaybeMutable>>
411 public function firstValue(): mixed;
413 /* Returns the first key from this Vector, or null if this Vector is empty.
414 * @return mixed
416 <<__Rx, __MaybeMutable>>
417 public function firstKey(): mixed {
418 return $this->count() ? 0 : null;
421 /* Returns the last value from this Vector, or null if this Vector is empty.
422 * @return mixed
424 <<__Native, __Rx, __MaybeMutable>>
425 public function lastValue(): mixed;
427 /* Returns the last key from this Vector, or null if this Vector is empty.
428 * @return mixed
430 <<__Rx, __MaybeMutable>>
431 public function lastKey(): mixed {
432 $count = $this->count();
433 return $count ? ($count - 1) : null;
436 /* Reverses the values of the Vector in place.
438 <<__Native, __Rx, __Mutable>>
439 public function reverse(): void;
441 /* Splices the values of the Vector in place (see the documentation for
442 * array_splice() on php.net for more details.
443 * @param mixed $offset
444 * @param mixed $len
445 * @param mixed $replacement
447 <<__Native, __Rx, __Mutable>>
448 public function splice(mixed $offset,
449 mixed $len = null,
450 mixed $replacement = null): void;
452 /* Returns index of the specified value if it is present, -1 otherwise.
453 * @param mixed $search_value
454 * @return int
456 <<__Native, __Rx, __MaybeMutable>>
457 public function linearSearch(mixed $search_value): int;
459 /* Shuffles the values of the Vector randomly in place.
461 <<__Native, __Rx, __Mutable>>
462 public function shuffle(): void;
464 /* @return string
466 <<__Rx, __MaybeMutable>>
467 public function __toString(): string { return "Vector"; }
469 /* @param mixed $name
470 * @return mixed
472 public function __get(mixed $name): mixed {
473 throw new \InvalidOperationException(
474 "Cannot access a property on a collection"
478 /* @param mixed $name
479 * @param mixed $value
480 * @return mixed
482 public function __set(mixed $name,
483 mixed $value): mixed {
484 throw new \InvalidOperationException(
485 "Cannot access a property on a collection"
489 /* @param mixed $name
490 * @return bool
492 public function __isset(mixed $name): bool { return false; }
494 /* @param mixed $name
495 * @return mixed
497 public function __unset(mixed $name): mixed {
498 throw new \InvalidOperationException(
499 "Cannot access a property on a collection"
503 /* Returns a Vector built from the values produced by the specified Iterable.
504 * @param mixed $iterable
505 * @return object
507 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
508 public static function fromItems(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
510 /* Returns a Vector built from the keys of the specified container.
511 * @param mixed $container
512 * @return object
514 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
515 public static function fromKeysOf(mixed $container): object;
517 /* Returns a Vector built from the values from the specified array.
518 * @param mixed $arr
519 * @return object
521 <<__Native>>
522 public static function fromArray(mixed $arr): object;
525 /* An immutable ordered collection where values are keyed using integers 0
526 * thru n-1 in order.
528 final class ImmVector implements \ConstVector {
530 /* Returns a ImmVector built from the values produced by the specified
531 * Iterable.
532 * @param mixed $iterable
534 <<__Native, __Rx, __OnlyRxIfArgs>>
535 public function __construct(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable = null): void;
537 /* Returns an ImmVector built from the values produced by the specified
538 * Iterable.
539 * @param mixed $iterable
540 * @return object
542 <<__Native, __Rx, __OnlyRxIfArgs, __MaybeMutable>>
543 public static function fromItems(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
545 /* Returns a ImmVector built from the keys of the specified container.
546 * @param mixed $container
547 * @return object
549 <<__Native, __Rx, __MaybeMutable>>
550 public static function fromKeysOf(mixed $container): object;
552 /* Returns true if the ImmVector is empty, false otherwise.
553 * @return bool
555 <<__Rx, __MaybeMutable>>
556 public function isEmpty(): bool {
557 return !$this->count();
560 /* Returns the number of values in the ImmVector.
561 * @return int
563 <<__Native, __Rx, __MaybeMutable>>
564 public function count(): int;
566 /* Returns an Iterable that produces the values from this ImmVector.
567 * @return object
569 <<__Rx, __MutableReturn, __MaybeMutable>>
570 public function items(): \LazyIterableView {
571 return new \LazyIterableView($this);
574 /* Returns true if the specified key is present in the ImmVector, returns
575 * false otherwise.
576 * @param mixed $key
577 * @return bool
579 <<__Rx, __MaybeMutable>>
580 public function containsKey(mixed $key): bool {
581 if (!\is_int($key)) {
582 throw new \InvalidArgumentException(
583 "Only integer keys may be used with Vectors"
586 return ($key >= 0) && ($key < $this->count());
589 /* Returns the value at the specified key. If the key is not present, an
590 * exception is thrown.
591 * @param mixed $key
592 * @return mixed
594 <<__Native, __Rx, __MaybeMutable>>
595 public function at(mixed $key): mixed;
597 /* Returns the value at the specified key. If the key is not present, null is
598 * returned.
599 * @param mixed $key
600 * @return mixed
602 <<__Native, __Rx, __MaybeMutable>>
603 public function get(mixed $key): mixed;
605 /* Returns an iterator that points to beginning of this ImmVector.
606 * @return object
608 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
609 public function getIterator(): object;
611 /* Returns a Vector of the values produced by applying the specified callback
612 * on each value from this ImmVector.
613 * @param mixed $callback
614 * @return object
616 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
617 public function map(<<__OnlyRxIfRxFunc>> mixed $callback): object;
619 /* Returns a Vector of the values produced by applying the specified callback
620 * on each key and value from this ImmVector.
621 * @param mixed $callback
622 * @return object
624 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
625 public function mapWithKey(<<__OnlyRxIfRxFunc>> mixed $callback): object;
627 /* Returns a Vector of all the values from this ImmVector for which the
628 * specified callback returns true.
629 * @param mixed $callback
630 * @return object
632 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
633 public function filter(<<__OnlyRxIfRxFunc>> mixed $callback): object;
635 /* Returns a Vector of all the values from this ImmVector for which the
636 * specified callback returns true.
637 * @param mixed $callback
638 * @return object
640 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
641 public function filterWithKey(<<__OnlyRxIfRxFunc>> mixed $callback): object;
643 /* Returns a KeyedIterable produced by combined the specified Iterables
644 * pair-wise.
645 * @param mixed $iterable
646 * @return object
648 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
649 public function zip(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
651 /* Returns a ImmVector containing the first n values of this ImmVector.
652 * @param mixed $n
653 * @return object
655 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
656 public function take(mixed $n): object;
658 /* Returns a ImmVector containing the values of this ImmVector up to but not
659 * including the first value that produces false when passed to the specified
660 * callback.
661 * @param mixed $callback
662 * @return object
664 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
665 public function takeWhile(<<__OnlyRxIfRxFunc>> mixed $callback): object;
667 /* Returns a ImmVector containing all values except the first n of this
668 * ImmVector.
669 * @param mixed $n
670 * @return object
672 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
673 public function skip(mixed $n): object;
675 /* Returns a ImmVector containing the values of this ImmVector excluding the
676 * first values that produces true when passed to the specified callback.
677 * @param mixed $fn
678 * @return object
680 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
681 public function skipWhile(<<__OnlyRxIfRxFunc>> mixed $fn): object;
683 /* Returns an ImmVector containing the specified range of values from this
684 * ImmVector. The range is specified by two non-negative integers: a starting
685 * position and a length.
686 * @param mixed $start
687 * @param mixed $len
688 * @return object
690 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
691 public function slice(mixed $start,
692 mixed $len): object;
694 /* Builds a new ImmVector by concatenating the elements of this ImmVector with
695 * the elements of the specified Iterable.
696 * @param mixed $iterable
697 * @return object
699 <<__Native, __Rx, __OnlyRxIfArgs, __MutableReturn, __MaybeMutable>>
700 public function concat(<<__MaybeMutable, __OnlyRxIfImpl(HH\Rx\Traversable::class)>> mixed $iterable): object;
702 /* Returns the first value from this ImmVector, or null if this ImmVector is
703 * empty.
704 * @return mixed
706 <<__Native, __Rx, __MaybeMutable>>
707 public function firstValue(): mixed;
709 /* Returns the first key from this ImmVector, or null if this ImmVector is
710 * empty.
711 * @return mixed
713 <<__Rx, __MaybeMutable>>
714 public function firstKey(): mixed {
715 return $this->count() ? 0 : null;
718 /* Returns the last value from this ImmVector, or null if this ImmVector is
719 * empty.
720 * @return mixed
722 <<__Native, __Rx, __MaybeMutable>>
723 public function lastValue(): mixed;
725 /* Returns the last key from this ImmVector, or null if this ImmVector is
726 * empty.
727 * @return mixed
729 <<__Rx, __MaybeMutable>>
730 public function lastKey(): mixed {
731 $count = $this->count();
732 return $count ? ($count - 1) : null;
735 /* Returns an Iterable that produces the keys from this ImmVector.
736 * @return object
738 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
739 public function keys(): object;
741 /* @return string
743 <<__Rx, __MaybeMutable>>
744 public function __toString(): string { return "ImmVector"; }
746 /* @param mixed $name
747 * @return mixed
749 public function __get(mixed $name): mixed {
750 throw new \InvalidOperationException(
751 "Cannot access a property on a collection"
755 /* @param mixed $name
756 * @param mixed $value
757 * @return mixed
759 public function __set(mixed $name,
760 mixed $value): mixed {
761 throw new \InvalidOperationException(
762 "Cannot access a property on a collection"
766 /* @param mixed $name
767 * @return bool
769 public function __isset(mixed $name): bool { return false; }
771 /* @param mixed $name
772 * @return mixed
774 public function __unset(mixed $name): mixed {
775 throw new \InvalidOperationException(
776 "Cannot access a property on a collection"
780 /* Returns a Vector built from the values of this ImmVector.
781 * @return object
783 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
784 public function toVector(): object;
786 /* Returns an immutable version of this collection.
787 * @return object
789 <<__Rx, __MaybeMutable>>
790 public function toImmVector(): this {
791 return $this;
794 /* Returns a Map built from the keys and values of this ImmVector.
795 * @return object
797 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
798 public function toMap(): object;
800 /* Returns a ImmMap built from the keys and values of this ImmVector.
801 * @return object
803 <<__Native, __Rx, __MaybeMutable>>
804 public function toImmMap(): object;
806 /* Returns a Set built from the values of this ImmVector.
807 * @return object
809 <<__Native, __Rx, __MutableReturn, __MaybeMutable>>
810 public function toSet(): object;
812 /* Returns a ImmSet built from the values of this ImmVector.
813 * @return object
815 <<__Native, __Rx, __MaybeMutable>>
816 public function toImmSet(): object;
818 /* Returns an immutable version of this collection.
819 * @return object
821 <<__Rx, __MaybeMutable>>
822 public function immutable(): this {
823 return $this;
826 /* Returns a clone of this ImmVector.
827 * @return object
829 <<__Rx, __MutableReturn, __MaybeMutable>>
830 public function values(): this {
831 return clone $this;
834 /* Returns a lazy iterable view of this ImmVector.
835 * @return object
837 <<__Rx, __MutableReturn, __MaybeMutable>>
838 public function lazy(): \LazyKeyedIterableView {
839 return new \LazyKeyedIterableView($this);
842 /* Returns an array built from the values from this ImmVector.
843 * @return array
845 <<__Native, __Rx, __MaybeMutable>>
846 public function toArray(): array;
848 <<__Native, __Rx, __MaybeMutable>>
849 public function toVArray(): varray;
851 <<__Native, __Rx, __MaybeMutable>>
852 public function toDArray(): darray;
854 /* Returns an array built from the keys from this ImmVector.
855 * @return array
857 <<__Rx, __MaybeMutable>>
858 public function toKeysArray(): array {
859 $count = $this->count();
860 return $count ? range(0, $count - 1) : array();
863 /* Returns an array built from the values from this ImmVector.
864 * @return array
866 <<__Rx, __MaybeMutable>>
867 public function toValuesArray(): array {
868 return $this->toArray();
871 /* Returns index of the specified value if it is present, -1 otherwise.
872 * @param mixed $search_value
873 * @return int
875 <<__Native, __Rx, __MaybeMutable>>
876 public function linearSearch(mixed $search_value): int;
879 } // namespace HH