public abstract class AbstractResultPage<E> extends Object implements ResultPage<E>
ResultPage.Foreach<E>, ResultPage.Reversable<E>, ResultPage.Sortable<E>| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
m_CurrentPage
当前页
|
protected int |
m_CurrentPageBegin
当前页最后一项的位置
|
protected int |
m_CurrentPageEnd
当前页第一项的位置
|
protected int |
m_CurrentPos
当前项位置
|
protected int |
m_NextCount
标记next的计数
|
protected int |
m_PageCount
总页数
|
protected int |
m_PageSize
每页项数
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractResultPage() |
protected |
AbstractResultPage(int nextCount) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
checkPageSize(int size)
检查是否超出页的最大项数
|
protected abstract E |
get(int idx)
由下标取得对象(需要子类实现)
|
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() |
protected boolean |
onCountNext(int nextCount)
若nextCount>=在每次next时调用其,且直至返回flase
|
E |
prev()
上一项(为支持上一项/下一项功能作扩展)
|
protected void |
reinit()
(重新初始化且)计算页数
|
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, waitclose, getCountforEachRemainingforEach, spliteratorprotected int m_PageSize
protected int m_PageCount
protected int m_CurrentPage
protected int m_CurrentPos
protected int m_CurrentPageEnd
protected int m_CurrentPageBegin
protected int m_NextCount
protected AbstractResultPage()
protected AbstractResultPage(int nextCount)
protected abstract E get(int idx)
idx - 在结果中的第N项(0~getCount()-1)protected boolean onCountNext(int nextCount)
nextCount - 最新next调用次数public int getPageCount()
ResultPagegetPageCount 在接口中 ResultPage<E>public int getPageSize()
ResultPagegetPageSize 在接口中 ResultPage<E>public void setPage(int page)
ResultPagesetPage 在接口中 ResultPage<E>page - 第N页public boolean gotoPage(int page)
ResultPagegotoPage 在接口中 ResultPage<E>page - 第N页protected void checkPageSize(int size)
size - 每页项数public void setPageSize(int size)
ResultPagesetPageSize 在接口中 ResultPage<E>size - 每页项数public boolean hasPrev()
ResultPagehasPrev 在接口中 ResultPage<E>public E prev()
ResultPageprev 在接口中 ResultPage<E>public E move(int pos)
ResultPagemove 在接口中 ResultPage<E>pos - 在当前页的位置(0~getPageSize()-1)public int getPage()
ResultPagegetPage 在接口中 ResultPage<E>public void sort(Comparator<E> c, int limit)
protected void reinit()
Copyright © 2022. All rights reserved.