简单的对list进行分页
来源:互联网 发布:瑞典帅哥成灾 知乎 编辑:程序博客网 时间:2024/06/07 18:13
/**
* 将List分页显示
*
* @param list 分页的List
* @param currentPage 显示那一页
* @param pageSize 每页显示数量
* @return List<Object>
*/
public static List showResulWithPage(List list, Integer currentPage, Integer pageSize) {
if (currentPage == null) {
throw new IllegalArgumentException("currentPage is null.");
}
if (pageSize == null) {
throw new IllegalArgumentException("pageSize is null.");
}
if (list.size() == 0 || list == null) {
return null;
}
List listNew = new ArrayList();
for (int i = (currentPage - 1) * pageSize; i < currentPage * pageSize && i < list.size(); i++) {
listNew.add(list.get(i));
}
return listNew;
}
* 将List分页显示
*
* @param list 分页的List
* @param currentPage 显示那一页
* @param pageSize 每页显示数量
* @return List<Object>
*/
public static List showResulWithPage(List list, Integer currentPage, Integer pageSize) {
if (currentPage == null) {
throw new IllegalArgumentException("currentPage is null.");
}
if (pageSize == null) {
throw new IllegalArgumentException("pageSize is null.");
}
if (list.size() == 0 || list == null) {
return null;
}
List listNew = new ArrayList();
for (int i = (currentPage - 1) * pageSize; i < currentPage * pageSize && i < list.size(); i++) {
listNew.add(list.get(i));
}
return listNew;
}
0 0
- 简单的对list进行分页
- 对list进行分页
- 对查询得到的List数据,进行分页操作
- 一个对List中的数据进行分页的工具类
- 对List(或DTO)进行分页查询
- 对List数组进行分页显示
- 利用 Google Guava 提供的便捷方法对 List 进行内存分页
- java中对list进行分页显示数据到页面
- java对List的分页操作
- 将list进行分页
- ThinkPHP 对数据库的数据进行分页
- 对list列表分页
- 对List分页显示
- 对List共用分页
- 对list分页
- 利用List的subList方法,实现对List分页
- 使用DNN的分页控件对DATALIST控件进行分页
- 分页(对查询出的数据进行分页显示)
- js中的for和for-in
- 使用selenium动态爬取
- Android中的ArrayAdapter
- 快速排序算法实施尾递归优化
- Android、Android Studio 操作记录
- 简单的对list进行分页
- 编译原理学习之运行时数据区的管理
- Oracle实现对查询结果每N条再次分组
- bootstrap3 文件上传插件fileinput中文说明文档
- php时间控制
- Leetcode NO.4 Median of Two Sorted Arrays
- 遍历 apr_table_t
- Linux学习11_linux grep命令及ps -ef | grep java的含义
- 孤儿进程与僵尸进程[总结]