当前位置: 首页>>代码示例>>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;未经允许,请勿转载。