E - public class UnionResultPage<E> extends Object implements ResultPage<E>
| 限定符和类型 | 字段和说明 |
|---|---|
protected Comparator<E> |
m_Comparator
用于比较结果项来确定返回位置
|
protected int |
m_Count
总项数
|
protected int |
m_CurrentPage
当前页
|
protected E[] |
m_Elements
当前页的集合
|
protected int |
m_PageCount
页数
|
protected int |
m_PagePos
当前的分页结果集
|
protected List<ResultPage<E>> |
m_Pages
多个分页结果集
|
protected int |
m_PageSize
每页项数
|
protected int |
m_Position
next位置
|
protected int |
m_Size
当前页的项数
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
UnionResultPage(List<ResultPage<E>> pages,
int count,
Comparator<E> comparator) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getCount()
总项数
|
int |
getPage()
当前所处的结果页
|
int |
getPageCount()
总页数
|
int |
getPageSize()
取每页的项数
|
boolean |
gotoPage(int page)
转到指定页(1-getPageCount())
|
boolean |
hasNext() |
boolean |
hasPrev()
是否有前一项
|
Iterator<E> |
iterator() |
E |
move(int pos)
移动到指定位置(相对于当前页)
|
E |
next() |
E |
prev()
上一项(为支持上一项/下一项功能作扩展)
|
void |
remove() |
void |
setPage(int page)
转到指定页(1-getPageCount())
|
void |
setPageSize(int size)
设置每页项数
|
void |
sort(Comparator<E> c,
int limit) |
String |
toString() |
static <E> ResultPage<E> |
union(List<ResultPage<E>> pages,
Comparator<E> comparator)
合并多个分页结果集合
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingforEach, spliteratorprotected List<ResultPage<E>> m_Pages
protected int m_PagePos
protected Comparator<E> m_Comparator
protected int m_Count
protected int m_PageSize
protected int m_PageCount
protected int m_CurrentPage
protected E[] m_Elements
protected int m_Size
protected int m_Position
protected UnionResultPage(List<ResultPage<E>> pages, int count, Comparator<E> comparator)
public static <E> ResultPage<E> union(List<ResultPage<E>> pages, Comparator<E> comparator)
E - 集合项类型pages - 分页集comparator - 与页结果排序一致的比较器,为null则只是简单遍历每个页结果public int getCount()
ResultPagegetCount 在接口中 ResultPage<E>public int getPage()
ResultPagegetPage 在接口中 ResultPage<E>public int getPageCount()
ResultPagegetPageCount 在接口中 ResultPage<E>public int getPageSize()
ResultPagegetPageSize 在接口中 ResultPage<E>public boolean gotoPage(int page)
ResultPagegotoPage 在接口中 ResultPage<E>page - 第N页public boolean hasPrev()
ResultPagehasPrev 在接口中 ResultPage<E>public E move(int pos)
ResultPagemove 在接口中 ResultPage<E>pos - 在当前页的位置(0~getPageSize()-1)public E prev()
ResultPageprev 在接口中 ResultPage<E>public void setPageSize(int size)
ResultPagesetPageSize 在接口中 ResultPage<E>size - 每页项数public void sort(Comparator<E> c, int limit)
public void setPage(int page)
ResultPagesetPage 在接口中 ResultPage<E>page - 第N页Copyright © 2021. All rights reserved.