當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Iterator::next方法代碼示例

本文整理匯總了PHP中Iterator::next方法的典型用法代碼示例。如果您正苦於以下問題:PHP Iterator::next方法的具體用法?PHP Iterator::next怎麽用?PHP Iterator::next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Iterator的用法示例。


在下文中一共展示了Iterator::next方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: lazyAppend

 /**
  * Lazily append the next iterator to the chain
  */
 private function lazyAppend()
 {
     if (!parent::valid() and $this->iterators->valid()) {
         $this->append($this->iterators->current());
         $this->iterators->next();
     }
 }
開發者ID:indigophp,項目名稱:iterators,代碼行數:10,代碼來源:LazyAppendIterator.php

示例2: next

 public function next()
 {
     $this->it->next();
     if ($this->currentLen !== 0) {
         --$this->currentLen;
     }
 }
開發者ID:ugochimbo,項目名稱:collections,代碼行數:7,代碼來源:LazySliceIterator.php

示例3: subscribe

 /**
  * @param ObserverInterface $observer
  * @param SchedulerInterface|null $scheduler
  * @return \Rx\Disposable\CompositeDisposable|\Rx\DisposableInterface
  */
 public function subscribe(ObserverInterface $observer, SchedulerInterface $scheduler = null)
 {
     $scheduler = $scheduler ?: new ImmediateScheduler();
     $key = 0;
     return $scheduler->scheduleRecursive(function ($reschedule) use(&$observer, &$key) {
         try {
             //HHVM requires you to call next() before current()
             if (defined('HHVM_VERSION')) {
                 $this->items->next();
                 $key = $this->items->key();
             }
             if (null === $key) {
                 $observer->onCompleted();
                 return;
             }
             $current = $this->items->current();
             $observer->onNext($current);
             if (!defined('HHVM_VERSION')) {
                 $this->items->next();
                 $key = $this->items->key();
             }
             $reschedule();
         } catch (\Exception $e) {
             $observer->onError($e);
         }
     });
 }
開發者ID:voryx,項目名稱:Rx.PHP,代碼行數:32,代碼來源:IteratorObservable.php

示例4: next

 public function next()
 {
     if (!$this->usingCache) {
         $this->innerIterator->next();
     }
     ++$this->position;
 }
開發者ID:wearebase,項目名稱:base-core,代碼行數:7,代碼來源:CachingIterator.php

示例5: next

 public function next()
 {
     $this->i++;
     if ($this->valid()) {
         $this->it->next();
     }
 }
開發者ID:gunjiro,項目名稱:ginq,代碼行數:7,代碼來源:TakeIterator.php

示例6: next

 public function next()
 {
     $this->projectionNeeded = true;
     unset($this->current);
     unset($this->currentKey);
     return $this->innerIterator->next();
 }
開發者ID:pombredanne,項目名稱:yasca,代碼行數:7,代碼來源:ProjectionKeyIterator.php

示例7: next

 public function next()
 {
     parent::next();
     if (!parent::valid()) {
         $this->source->next();
     }
 }
開發者ID:bugadani,項目名稱:monad,代碼行數:7,代碼來源:ArrayCallbackIterator.php

示例8: next

 public function next()
 {
     while (true) {
         $this->it->next();
         if ($this->it->valid()) {
             if ($this->fetch()) {
                 break;
             }
         } else {
             if ($this->it === $this->it0) {
                 $this->it = $this->it1;
                 $this->it->rewind();
                 if ($this->it->valid()) {
                     if ($this->fetch()) {
                         break;
                     }
                 } else {
                     break;
                 }
             } else {
                 break;
             }
         }
     }
 }
開發者ID:gunjiro,項目名稱:ginq,代碼行數:25,代碼來源:UnionIterator.php

示例9: next

 /**
  * {@inheritdoc}
  */
 public function next()
 {
     $this->neighbour->next();
     if (!$this->neighbour->valid()) {
         $this->neighbour->rewind();
         parent::next();
     }
 }
開發者ID:th3n3rd,項目名稱:cartesian-product,代碼行數:11,代碼來源:Set.php

示例10: next

 public function next()
 {
     $this->currentIt->next();
     if ($this->state === 1 && !$this->currentIt->valid()) {
         $this->currentIt = $this->it2;
         $this->state = 2;
     }
 }
開發者ID:ugochimbo,項目名稱:collections,代碼行數:8,代碼來源:LazyConcatIterator.php

示例11: next

 public function next()
 {
     $this->i++;
     if ($this->cacheSize == $this->i) {
         $this->it->next();
         $this->memo();
     }
 }
開發者ID:gunjiro,項目名稱:ginq,代碼行數:8,代碼來源:MemoizeIterator.php

示例12: next

 public function next()
 {
     $this->i++;
     $this->it->next();
     if ($this->it === $this->it0 && !$this->it->valid()) {
         $this->it = $this->it1;
     }
 }
開發者ID:gunjiro,項目名稱:ginq,代碼行數:8,代碼來源:ConcatIterator.php

示例13: next

 public function next()
 {
     $this->points->next();
     if (!$this->points->valid()) {
         $this->series->next();
         $serie = $this->series->current();
         $this->points = new \ArrayIterator($serie ? $serie['values'] : []);
     }
 }
開發者ID:undera,項目名稱:doctrine-dbal-influxdb,代碼行數:9,代碼來源:ResultSetIterator.php

示例14: next

 /**
  * {@inheritdoc}
  */
 public function next()
 {
     $this->key++;
     $this->getCurrentIterator()->next();
     if (!$this->currentIterator->valid()) {
         $this->mainIterator->next();
         $this->currentIterator = $this->mainIterator->current();
     }
 }
開發者ID:adrienbrault,項目名稱:pagerfanta-iterator,代碼行數:12,代碼來源:IteratorIterator.php

示例15: next

 public function next()
 {
     $this->i++;
     $this->it->next();
     $v = $this->it->valid();
     if (!$v) {
         $this->it->rewind();
     }
 }
開發者ID:gunjiro,項目名稱:ginq,代碼行數:9,代碼來源:CycleIterator.php


注:本文中的Iterator::next方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。