Package org.alfresco.repo.web.util
Class PagingCursor.Page
- java.lang.Object
-
- org.alfresco.repo.web.util.PagingCursor.Page
-
- Enclosing class:
- PagingCursor
public static class PagingCursor.Page extends Object
Page based Cursor
-
-
Constructor Summary
Constructors Constructor Description Page(long totalRows, int rowsPerPage, int page, boolean zeroBasedPage, boolean zeroBasedRow)Create a Page based Cursor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCurrentPage()Gets the current page numberlonggetEndRow()Gets the end row within collection for this pageintgetFirstPage()Gets the first page numberintgetLastPage()Gets the last page numberintgetNextPage()Gets the next page numberintgetPreviousPage()Gets the previous page numberintgetRowsPerPage()Gets page sizelonggetStartRow()Gets the start row within collection for this pageintgetTotalPages()Gets total number of pageslonggetTotalRows()Gets total rowsbooleanisInRange()Is the cursor within range of the total number of rows
-
-
-
Constructor Detail
-
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 Detail
-
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
-
-