public function zip(Iterable $iterable)
 {
     $res = new static();
     $it = $iterable->getIterator();
     foreach ($this as $v) {
         if (!$it->valid()) {
             break;
         }
         $res[] = new Pair($v, $it->current());
         $it->next();
     }
     return $res;
 }
 public function getIterator()
 {
     return new LazyTakeWhileKeyedIterator($this->iterable->getIterator(), $this->fn);
 }
 public function getIterator()
 {
     return new LazySkipIterator($this->iterable->getIterator(), $this->n);
 }
 public function getIterator()
 {
     return new LazySliceIterator($this->iterable->getIterator(), $this->start, $this->len);
 }
 public function getIterator()
 {
     return new LazyFilterIterator($this->iterable->getIterator(), $this->fn);
 }
 public function getIterator()
 {
     return new LazyKeysIterator($this->iterable->getIterator());
 }
 public function getIterator()
 {
     return new LazyZipIterator($this->iterable1->getIterator(), $this->iterable2->getIterator());
 }
Beispiel #8
0
 /**
  * @inheritDoc
  */
 public function removeAll(Iterable $iterable)
 {
     $iterable->each(function ($item) {
         if ($this->contains($item)) {
             $this->remove($item);
         }
     });
     return $this;
 }