Class PagingCursor.Page

  • Enclosing class:
    PagingCursor

    public static class PagingCursor.Page
    extends java.lang.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
    • 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 collection
        rowsPerPage - page size
        page - page number (0 or 1 based)
        zeroBasedPage - true => 0 based, false => 1 based
        zeroBasedRow - 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