Paginates through pages of an entity.
@return an encapsulation of the pages of an entity
@throws BackendException if there was any trouble paginating
493443
public R call() throws BackendException {
        while (hasNext) {
            pagesProcessed++;
            next();
        }
        delegate.updatePagesHistogram(apiName, tableName, pagesProcessed);
        return getMergedPages();
    }
1374157
protected void getNextPage() {
		    	    	
        final JSONObject params = new JSONObject();
        
        page++;
        
        params.put("page", page);
        params.put("size", size);
        
        clear();
        
        getPage(params);
                
	}
1126935
public function indexAction()
    {
        $businessEntityHelper = $this->get('victoire_core.helper.business_entity_helper');

        //services
        $em = $this->get('doctrine.orm.entity_manager');

        //the repository
        $repository = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate');

        $BusinessTemplates = [];

        $businessEntities = $businessEntityHelper->getBusinessEntities();

        foreach ($businessEntities as $businessEntity) {
            $name = $businessEntity->getName();

            //retrieve the pagePatterns
            $pagePatterns = $repository->findPagePatternByBusinessEntity($businessEntity);

            $BusinessTemplates[$name] = $pagePatterns;
        }

        return new JsonResponse([
                'html' => $this->container->get('templating')->render(
                    'VictoireBusinessPageBundle:BusinessEntity:index.html.twig',
                    [
                        'businessEntities'  => $businessEntities,
                        'BusinessTemplates' => $BusinessTemplates,
                    ]
                ),
                'success' => true,
            ]);
    }
746392
public Page<T> previousPage(final Page<T> page) {
        return previousPage(page, Twilio.getRestClient());
    }
909329
public PageResult<Entity> page(Connection conn, Collection<String> fields, Entity where, int page, int numPerPage) throws SQLException {
		checkConn(conn);
		
		final int count = count(conn, where);
		PageResultHandler pageResultHandler = PageResultHandler.create(new PageResult<Entity>(page, numPerPage, count));
		return this.page(conn, fields, where, page, numPerPage, pageResultHandler);
	}
1289221
protected static function getSysPageObj()
    {
        if (self::$sysPageObj === null) {
            /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
            $objectManager = Typo3GeneralUtility::makeInstance(
                'TYPO3\\CMS\\Extbase\\Object\\ObjectManager'
            );

            /** @var \TYPO3\CMS\Frontend\Page\PageRepository $sysPageObj */
            $sysPageObj = $objectManager->get('TYPO3\\CMS\\Frontend\\Page\\PageRepository');

            self::$sysPageObj = $sysPageObj;
        }

        return self::$sysPageObj;
    }
993460
@XmlElementWrapper(name = "links")
    @XmlElement(name = "link")
    @JsonProperty(value = "links")
    @ApiModelProperty(value = "The pagination links.", position = 3)
    public List<PageRequestLinkDto> getLinks() {
        return links;
    }
150325
protected final PrcEntitiesPage
    createPutPrcEntitiesPage() throws Exception {
    PrcEntitiesPage proc = new PrcEntitiesPage();
    proc.setSrvEntitiesPage(this.srvEntitiesPage);
    //assigning fully initialized object:
    this.processorsMap
      .put(PrcEntitiesPage.class.getSimpleName(), proc);
    return proc;
  }
412596
public @Nullable Page getPage(@NotNull Page basePage) {
    return getPage((Predicate<Page>)null, basePage);
  }
999337
def _entity_paginator(namespace, workspace, etype, page_size=500,
                            filter_terms=None, sort_direction="asc"):
    

    page = 1
    all_entities = []
    # Make initial request
    r = fapi.get_entities_query(namespace, workspace, etype, page=page,
                           page_size=page_size, sort_direction=sort_direction,
                           filter_terms=filter_terms)
    fapi._check_response_code(r, 200)

    response_body = r.json()
    # Get the total number of pages
    total_pages = response_body['resultMetadata']['filteredPageCount']

    # append the first set of results
    entities = response_body['results']
    all_entities.extend(entities)
    # Now iterate over remaining pages to retrieve all the results
    page = 2
    while page <= total_pages:
        r = fapi.get_entities_query(namespace, workspace, etype, page=page,
                               page_size=page_size, sort_direction=sort_direction,
                               filter_terms=filter_terms)
        fapi._check_response_code(r, 200)
        entities = r.json()['results']
        all_entities.extend(entities)
        page += 1

    return all_entities
376064
public PaginatedList<Company> list(int page) {
		PaginatedList<Company> results = new PaginatedList<Company>();
		Criteria criteria = this.dao.newCriteria(Company.class).add(Restrictions.eq("deleted", false)).addOrder(Order.asc("name"));
		if (page > 0)
			criteria.setFirstResult((page-1) * PAGESIZE).setMaxResults(PAGESIZE);
		Criteria counting = this.dao.newCriteria(Company.class).setProjection(Projections.countDistinct("id"))
				.add(Restrictions.eq("deleted", false));
		results.setList(this.dao.findByCriteria(criteria, Company.class));
		results.setTotal((Long) counting.uniqueResult());
		return results;
	}
202578
public static <StoredObjectType, ResultSetType> Pagination createPagination(PageCriteria pageCriteria)
    {
    	String id = pageCriteria.getId();
    	
    	if(id == null || id.length() == 0) 
    	{
    		return null;
    	}
    	Pagination pagination = ClassPath.newInstance(paginationClassName,String.class,pageCriteria.getId());
    	
    	paginationMap.put(id, pagination);
    	
    	return pagination;
		 
    	
    }
134337
@Override
  public Iterator<Page<T>> iterator() {

    return new Iterator<Page<T>>() {

      int currentIndex = 0;
      int currentPageNumber = 1;
      int pageSize = getPageSize();

      @Override
      public boolean hasNext() {
        return this.currentIndex < getList().size();
      }

      @Override
      public Page<T> next() {

        Assert.isTrue(hasNext(), new NoSuchElementException("No more pages"));

        Page<T> page = SimplePage.of(SimplePageable.this, this.currentPageNumber);

        this.currentIndex += this.pageSize;
        this.currentPageNumber++;

        return page;
      }
    };
  }
1216507
def pagination(title, options, collection, &block)
      start_line, options[:limit], options[:header] = pagination_limit(title, options)
      if collection.size > (options[:limit] - options[:header]) # minus pagination header
        key   = Device::IO.back_key
        pages = pagination_page(collection, options[:limit] - options[:header]) # minus pagination header
        page  = 1
        while(key == Device::IO.back_key || key == Device::IO.forward_key)
          Device::Display.clear
          pagination_header(title, page, pages.size, start_line, options[:default], options[:header])
          values = pages[page].to_a
          block.call(values, start_line + options[:header])
          key  = try_key(pagination_keys(values.size, true))
          page = pagination_key_page(page, key, pages.size)
        end
      else
        Device::Display.clear
        print_title(title, options[:default]) if title
        values = collection.to_a
        block.call(values, start_line)
        key = try_key(pagination_keys(collection.size, false))
      end
      result = values[key.to_i-1] if key.integer?
      if result.is_a? Array
        [key, result[1]]
      else
        [key, result]
      end
    end
740921
public Observable<ServiceResponse<Page<ApplicationGatewayInner>>> listAllSinglePageAsync() {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        final String apiVersion = "2017-10-01";
        return service.listAll(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ApplicationGatewayInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ApplicationGatewayInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ApplicationGatewayInner>> result = listAllDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ApplicationGatewayInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
479003
@Override
  public Iterator<Entity> iterator() {
    Stream<Entity> entities = delegate().findAll(new QueryImpl<>());
    return resolveEntityReferences(entities).iterator();
  }
1151697
protected List<String> getPages() {

        if (m_pages == null) {
            m_pages = Arrays.asList(getPageArray());
        }
        return m_pages;
    }