• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Pageable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gbif.api.model.common.paging.Pageable的典型用法代码示例。如果您正苦于以下问题:Java Pageable类的具体用法?Java Pageable怎么用?Java Pageable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Pageable类属于org.gbif.api.model.common.paging包,在下文中一共展示了Pageable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: list

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public List<Dataset> list() {
PagingResponse<Dataset> response = list((Pageable)null);
if(response == null)
    return null;

List<Dataset> datasets = Lists.newArrayList(response.getResults());
boolean isInitial = false;
int limit = -1;
while(Pager.isEndOfRecords(response)) {
    if(isInitial) {
	limit = Pager.getMaxLimit(response);
    }
    response.setOffset(response.getOffset() + response.getLimit());
    if(isInitial) {
	response.setLimit(limit);
	isInitial = false;
    }

    response = list(response);
    datasets.addAll(response.getResults());
}

return datasets;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:25,代码来源:DatasetAPIClient.java


示例2: list

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
/**
 * This retrieves a list of all NameUsage from ChecklistBank.
 *
 * @param locale      identifier for a region
 * @param datasetKeys the optional checklist keys to limit paging to
 * @param page        the limit, offset paging information
 * @return requested list of NameUsage or an empty list if none could be found
 */
@GET
public PagingResponse<NameUsage> list(@Context Locale locale, @QueryParam(DATASET_KEY) Set<UUID> datasetKeys,
                                      @QueryParam("sourceId") String sourceId, @QueryParam("name") String canonicalName, @Context Pageable page) {

  // limit the maximum allowed offset
  checkDeepPaging(page);

  if (datasetKeys == null) {
    datasetKeys = ImmutableSet.of();
  }
  if (Strings.isNullOrEmpty(canonicalName)) {
    if (datasetKeys.size() > 1) {
      // https://github.com/gbif/checklistbank/issues/54
      throw new IllegalArgumentException("Multiple datasetKey parameters are not allowed");
    }
    return nameUsageService.list(locale,
        datasetKeys.isEmpty() ? null : datasetKeys.iterator().next(), sourceId, page);
  } else {
    return nameUsageService.listByCanonicalName(locale, canonicalName, page,
        datasetKeys.isEmpty() ? null : datasetKeys.toArray(new UUID[datasetKeys.size()]));
  }
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:31,代码来源:SpeciesResource.java


示例3: visitOwnedDatasets

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
private void visitOwnedDatasets(UUID orgKey, DatasetVisitor visitor) {
  int datasetCount = 0;
  boolean endOfRecords = false;
  int offset = 0;
  do {
    Pageable page = new PagingRequest(offset, PAGING_LIMIT);
    PagingResponse<Dataset> datasets = orgService.publishedDatasets(orgKey, page);

    for (Dataset dataset : datasets.getResults()) {
      visitor.visit(dataset.getKey());
    }
    datasetCount += datasets.getResults().size();
    offset += PAGING_LIMIT;

    if (datasets.isEndOfRecords()) {
      endOfRecords = datasets.isEndOfRecords();
    }
  } while (!endOfRecords);
  LOG.info("Visited [{}] datasets owned by org [{}]", datasetCount, orgKey);
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:21,代码来源:RegistryChangeListener.java


示例4: list

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
@Override
public PagingResponse<Dataset> list(@Nullable Pageable page) {
  if (page == null) {
    page = new PagingResponse<Dataset>();
  }
  PagingResponse<Dataset> resp = new PagingResponse<Dataset>();
  int idx = 1;
  for (Map.Entry<UUID, Dataset> e: datasets.entrySet()) {
    if (idx >= page.getOffset()) {
      if (idx >= page.getLimit()) {
        break;
      }
      resp.getResults().add(e.getValue());
    }
    idx++;
  }
  resp.setCount((long) datasets.size());
  return resp;
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:20,代码来源:DatasetServiceFileImpl.java


示例5: get

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
protected static String get(Pageable pager, int increment) {
StringBuffer pageParameter = new StringBuffer();
if(pager != null) {
    pageParameter.append("limit=").append(pager.getLimit()).append("&offset=").append(pager.getOffset() + increment);
}
return pageParameter.toString();
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:8,代码来源:Pager.java


示例6: search

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public List<Dataset> search(String query) {
PagingResponse<Dataset> response = search(query, (Pageable)null);
if(response == null)
    return null;

List<Dataset> datasets = Lists.newArrayList(response.getResults());
while(Pager.isEndOfRecords(response)) {
    response.setOffset(response.getOffset() + response.getLimit());
    response = search(query, response);
    datasets.addAll(response.getResults());
}

return datasets;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:15,代码来源:DatasetAPIClient.java


示例7: listByIdentifier

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public List<Dataset> listByIdentifier(IdentifierType type, String identifier) 
   {
PagingResponse<Dataset> response = listByIdentifier(type, identifier, (Pageable)null);
if(response == null)
    return null;

List<Dataset> datasets = Lists.newArrayList(response.getResults());
while(Pager.isEndOfRecords(response)) {
    response.setOffset(response.getOffset() + response.getLimit());
    response = listByIdentifier(type, identifier, response);
    datasets.addAll(response.getResults());
}

return datasets;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:16,代码来源:DatasetAPIClient.java


示例8: list

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<NameUsage> list(Locale locale, @Nullable UUID datasetKey, @Nullable String sourceId, @Nullable Pageable page)
   {
PagingResponse<NameUsage> response = null;
try {
    response = list(page, datasetKey, sourceId, locale);
}
catch (IOException e) {
}
return response;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:11,代码来源:SpeciesAPIClient.java


示例9: listByCanonicalName

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<NameUsage> listByCanonicalName(Locale locale, String canonicalName, @Nullable Pageable page,
					       @Nullable UUID ... datasetKey)
   {
PagingResponse<NameUsage> response = null;
try {
    response = listByCanonicalName(page, canonicalName, getList(locale), datasetKey);
}
catch (IOException e) {
}

return response;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:13,代码来源:SpeciesAPIClient.java


示例10: listByUser

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
@Override
public PagingResponse<Download> listByUser(
  @NotNull String s, @Nullable Pageable pageable, @Nullable Set<Download.Status> status
) {
  // TODO: Write implementation
  throw new UnsupportedOperationException("Not implemented yet");
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:8,代码来源:OccurrenceDownloadMockServices.java


示例11: listByUsage

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
@Override
public PagingResponse<NameUsageMediaObject> listByUsage(int usageKey, @Nullable Pageable page) {
  PagingResponse<NameUsageMediaObject> result = super.listByUsage(usageKey, page);
  //TODO: avoid live interpretations until we store the type properly
  for (NameUsageMediaObject m : result.getResults()) {
    MediaTypeUtils.detectType(m);
  }
  return result;
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:10,代码来源:MultimediaServiceMyBatis.java


示例12: list

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
@Override
public PagingResponse<Download> list(
  @Nullable Pageable pageable, @Nullable Set<Download.Status> status
) {
  // TODO: Write implementation
  throw new UnsupportedOperationException("Not implemented yet");
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:8,代码来源:OccurrenceDownloadMockServices.java


示例13: getNextPage

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public static String getNextPage(Pageable pager) {
return get(pager, 1);
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:4,代码来源:Pager.java


示例14: listConstituents

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<Dataset> listConstituents(@Nullable Pageable page)
   {
return null;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:DatasetAPIClient.java


示例15: listByCountry

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<Dataset> listByCountry(Country country, @Nullable DatasetType type, @Nullable Pageable page)
   {
return null;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:DatasetAPIClient.java


示例16: listByType

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<Dataset> listByType(DatasetType type, @Nullable Pageable page)
   {
return null;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:DatasetAPIClient.java


示例17: listDeleted

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<Dataset> listDeleted(@Nullable Pageable page)
   {
return null;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:DatasetAPIClient.java


示例18: listDuplicates

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<Dataset> listDuplicates(@Nullable Pageable page)
   {
return null;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:DatasetAPIClient.java


示例19: listDatasetsWithNoEndpoint

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<Dataset> listDatasetsWithNoEndpoint(@Nullable Pageable page)
   {
return null;
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:DatasetAPIClient.java


示例20: listChildren

import org.gbif.api.model.common.paging.Pageable; //导入依赖的package包/类
public PagingResponse<NameUsage> listChildren(int parentKey, Locale locale, @Nullable Pageable page)
   {
return listChildren(page, parentKey, locale);
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:5,代码来源:SpeciesAPIClient.java



注:本文中的org.gbif.api.model.common.paging.Pageable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Slice类代码示例发布时间:2022-05-23
下一篇:
Java CityObjectMember类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap