Package org.alfresco.repo.web.util
Class PagingCursor.Page
java.lang.Object
org.alfresco.repo.web.util.PagingCursor.Page
- Enclosing class:
- PagingCursor
Page based Cursor
-
Constructor Summary
ConstructorsConstructorDescriptionPage
(long totalRows, int rowsPerPage, int page, boolean zeroBasedPage, boolean zeroBasedRow) Create a Page based Cursor -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the current page numberlong
Gets the end row within collection for this pageint
Gets the first page numberint
Gets the last page numberint
Gets the next page numberint
Gets the previous page numberint
Gets page sizelong
Gets the start row within collection for this pageint
Gets total number of pageslong
Gets total rowsboolean
Is the cursor within range of the total number of rows
-
Constructor Details
-
Page
public Page(long totalRows, int rowsPerPage, int page, boolean zeroBasedPage, boolean zeroBasedRow) Create a Page based Cursor- Parameters:
totalRows
- total rows in collectionrowsPerPage
- page sizepage
- page number (0 or 1 based)zeroBasedPage
- true => 0 based, false => 1 basedzeroBasedRow
- true => 0 based, false => 1 based
-
-
Method Details
-
getTotalRows
public long getTotalRows()Gets total rows- Returns:
- total rows
-
getTotalPages
public int getTotalPages()Gets total number of pages- Returns:
- total number of pages
-
getRowsPerPage
public int getRowsPerPage()Gets page size- Returns:
- page size
-
isInRange
public boolean isInRange()Is the cursor within range of the total number of rows- Returns:
- true => within range of total rows
-
getCurrentPage
public int getCurrentPage()Gets the current page number- Returns:
- current page number
-
getNextPage
public int getNextPage()Gets the next page number- Returns:
- next page number (-1 if no more pages)
-
getPreviousPage
public int getPreviousPage()Gets the previous page number- Returns:
- previous page number (-1 if no previous pages)
-
getFirstPage
public int getFirstPage()Gets the first page number- Returns:
- first page number
-
getLastPage
public int getLastPage()Gets the last page number- Returns:
- last page number
-
getStartRow
public long getStartRow()Gets the start row within collection for this page- Returns:
- start row index
-
getEndRow
public long getEndRow()Gets the end row within collection for this page- Returns:
- end row index
-