public class ResultPageUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ResultPageUtil.Empty<E>
没结果项的ResultPage快速封装
|
static class |
ResultPageUtil.Foreach<E>
遍历ResultPage
|
static class |
ResultPageUtil.OnList<E>
直接由List封装为ResultPage
|
static class |
ResultPageUtil.Reverse<E>
反转ResultPage结果(相当于倒排序)
|
static class |
ResultPageUtil.Singleton<E>
当结果只有一项时,能使用其作简单快捷的封装
|
static class |
ResultPageUtil.Union<E>
把多个分页结果集合并封装在一起
|
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
_max_turning_pages
最大的连续翻页数(默认10000,0为不限,超过抛出OverloadException异常)
|
| 构造器和说明 |
|---|
ResultPageUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> ResultPage<E> |
empty() |
static <E> Iterable<E> |
foreach(ResultPage<E> rp)
转为可(foreach)遍历的Iterable
|
static <E> Iterable<E> |
foreach(ResultPage<E> rp,
int page)
转为可(foreach)遍历的Iterable
|
static <E> List<E> |
list(ResultPage<E> rp,
Comparator<E> c,
int limit)
转换ResultPage中前部分的项为List,且对其进行排序
|
static <E> List<E> |
list(ResultPage<E> rp,
int limit)
转换ResultPage中前部分的项为List
|
static <E> ResultPage<E> |
of(List<? super E> ls)
快速封装(构造)基于List的ResultPage
|
static <E> ResultPage<E> |
reverse(ResultPage<E> rp)
反转ResultPage
|
static <E> ResultPage<E> |
singleton(E element)
快速封装(构造)单结果项ResultPage
|
static <E> ResultPage<E> |
sort(ResultPage<E> rp,
Comparator<E> c,
int limit)
将结果集按比较器排序
|
static <E> ResultPage<E> |
union(List<ResultPage<E>> pages,
Comparator<E> comparator)
合并多个分页结果集合
|
public static final int _max_turning_pages
public static <E> ResultPage<E> singleton(E element)
E - 项类型element - 结果项public static <E> ResultPage<E> of(List<? super E> ls)
E - ls - 结果集(List)public static <E> ResultPage<E> empty()
public static <E> ResultPage<E> reverse(ResultPage<E> rp)
E - 项类型rp - 反转前的页结果public static <E> List<E> list(ResultPage<E> rp, int limit)
E - 结果项类型rp - 页结果limit - 限制转换的项数public static <E> List<E> list(ResultPage<E> rp, Comparator<E> c, int limit)
E - 结果项类型rp - 页结果c - 排序比较器limit - 限制转换的项数public static <E> ResultPage<E> sort(ResultPage<E> rp, Comparator<E> c, int limit)
E - 结果项类型rp - 页结果c - 排序比较器limit - 限制排序的项数public static <E> Iterable<E> foreach(ResultPage<E> rp)
E - 结果项类型rp - 页结果public static <E> Iterable<E> foreach(ResultPage<E> rp, int page)
E - 结果项类型rp - 页结果page - 开始页(1~N)public static <E> ResultPage<E> union(List<ResultPage<E>> pages, Comparator<E> comparator)
E - 集合项类型pages - 分页集comparator - 与页结果排序一致的比较器,为null则只是简单遍历每个页结果Copyright © 2022. All rights reserved.