org.alfresco.repo.web.util
Class PagingCursor.Page

java.lang.Object
  extended by org.alfresco.repo.web.util.PagingCursor.Page
Enclosing class:
PagingCursor

public static class PagingCursor.Page
extends java.lang.Object

Page based Cursor


Constructor Summary
PagingCursor.Page(long totalRows, int rowsPerPage, int page, boolean zeroBasedPage, boolean zeroBasedRow)
          Create a Page based Cursor
 
Method Summary
 int getCurrentPage()
          Gets the current page number
 long getEndRow()
          Gets the end row within collection for this page
 int getFirstPage()
          Gets the first page number
 int getLastPage()
          Gets the last page number
 int getNextPage()
          Gets the next page number
 int getPreviousPage()
          Gets the previous page number
 int getRowsPerPage()
          Gets page size
 long getStartRow()
          Gets the start row within collection for this page
 int getTotalPages()
          Gets total number of pages
 long getTotalRows()
          Gets total rows
 boolean isInRange()
          Is the cursor within range of the total number of rows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PagingCursor.Page

public PagingCursor.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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.