#820 - #718 Removed PagedList.getPageIndex() - Can it be added back?

This commit is contained in:
Robin Bygrave
2016-09-22 20:57:17 +12:00
parent a0f2ebe448
commit b753ce3a73
3 changed files with 121 additions and 0 deletions
@@ -207,6 +207,14 @@ public interface PagedList<T> {
*/
int getPageSize();
/**
* Return the index position of this page (Zero based).
* <p>
* This is a calculated value based on firstRow/maxRows.
* </p>
*/
int getPageIndex();
/**
* Return true if there is a next page.
* <p>
@@ -73,6 +73,14 @@ public class LimitOffsetPagedList<T> implements PagedList<T> {
}
}
@Override
public int getPageIndex() {
if (firstRow == 0) {
return 0;
}
return ((firstRow - 1) / maxRows) + 1;
}
public int getTotalPageCount() {
int rowCount = getTotalCount();