public static class ResultPageUtil.Union<E> extends Object implements ResultPage<E>
ResultPage.Foreach<E>, ResultPage.Reversable<E>, ResultPage.Sortable<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 int |
m_PageSize
每页项数
|
protected int |
m_Position
next位置
|
protected List<ResultPage<E>> |
m_Results
多个分页结果集
|
protected int |
m_Size
当前页的项数
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
Union(List<ResultPage<E>> pages,
int count,
Comparator<E> comparator) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭
|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingforEach, spliteratorprotected List<ResultPage<E>> m_Results
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 Union(List<ResultPage<E>> pages, int count, Comparator<E> comparator)
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页public void close()
throws Exception
ResultPageclose 在接口中 ResultPage<E>close 在接口中 AutoCloseableExceptionCopyright © 2022. All rights reserved.