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 TypeMethodDescriptionintGets the current page numberlongGets the end row within collection for this pageintGets the first page numberintGets the last page numberintGets the next page numberintGets the previous page numberintGets page sizelongGets the start row within collection for this pageintGets total number of pageslongGets total rowsbooleanIs 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
-