Package org.alfresco.query
Class CannedQueryPageDetails
- java.lang.Object
-
- org.alfresco.query.CannedQueryPageDetails
-
public class CannedQueryPageDetails extends Object
Details for canned queries supporting paged results. Results areskipped, chopped into pages ofappropriate sizebefore thestart pageandnumberare returned.- Since:
- 4.0
- Author:
- Derek Hulley
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PAGE_COUNTstatic intDEFAULT_PAGE_NUMBERstatic intDEFAULT_PAGE_SIZEstatic intDEFAULT_SKIP_RESULTS
-
Constructor Summary
Constructors Constructor Description CannedQueryPageDetails()Construct with defaults skipResults:DEFAULT_SKIP_RESULTSpageSize:DEFAULT_PAGE_SIZEpageNumber:DEFAULT_PAGE_NUMBERpageCount:DEFAULT_PAGE_COUNTCannedQueryPageDetails(int skipResults, int pageSize)Construct with defaults pageNumber:DEFAULT_PAGE_NUMBERpageCount:DEFAULT_PAGE_COUNTCannedQueryPageDetails(int skipResults, int pageSize, int pageNumber, int pageCount)CannedQueryPageDetails(PagingRequest pagingRequest)Helper constructor to transform a paging request into the Canned Query form.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPageCount()Get the total number of pages to returnintgetPageNumber()Get the first page number to returnintgetPageSize()Get the size of each pageintgetResultsRequiredForPaging()Calculate the number of results that would be required to satisy this paging request.intgetSkipResults()Get the number of query results to skip before applying further page parametersStringtoString()
-
-
-
Field Detail
-
DEFAULT_SKIP_RESULTS
public static final int DEFAULT_SKIP_RESULTS
- See Also:
- Constant Field Values
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_PAGE_NUMBER
public static final int DEFAULT_PAGE_NUMBER
- See Also:
- Constant Field Values
-
DEFAULT_PAGE_COUNT
public static final int DEFAULT_PAGE_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CannedQueryPageDetails
public CannedQueryPageDetails()
Construct with defaults- skipResults:
DEFAULT_SKIP_RESULTS - pageSize:
DEFAULT_PAGE_SIZE - pageNumber:
DEFAULT_PAGE_NUMBER - pageCount:
DEFAULT_PAGE_COUNT
- skipResults:
-
CannedQueryPageDetails
public CannedQueryPageDetails(int skipResults, int pageSize)Construct with defaults- pageNumber:
DEFAULT_PAGE_NUMBER - pageCount:
DEFAULT_PAGE_COUNT
- Parameters:
skipResults- results to skip before page one (defaultDEFAULT_SKIP_RESULTS)pageSize- the size of each page (defaultDEFAULT_PAGE_SIZE)
- pageNumber:
-
CannedQueryPageDetails
public CannedQueryPageDetails(int skipResults, int pageSize, int pageNumber, int pageCount)- Parameters:
skipResults- results to skip before page one (defaultDEFAULT_SKIP_RESULTS)pageSize- the size of each page (defaultDEFAULT_PAGE_SIZE)pageNumber- the first page number to return (defaultDEFAULT_PAGE_NUMBER)pageCount- the number of pages to return (defaultDEFAULT_PAGE_COUNT)
-
CannedQueryPageDetails
public CannedQueryPageDetails(PagingRequest pagingRequest)
Helper constructor to transform a paging request into the Canned Query form.- Parameters:
pagingRequest- the paging details
-
-
Method Detail
-
getSkipResults
public int getSkipResults()
Get the number of query results to skip before applying further page parameters- Returns:
- results to skip before page one
-
getPageSize
public int getPageSize()
Get the size of each page- Returns:
- the size of each page
-
getPageNumber
public int getPageNumber()
Get the first page number to return- Returns:
- the first page number to return
-
getPageCount
public int getPageCount()
Get the total number of pages to return- Returns:
- the number of pages to return
-
getResultsRequiredForPaging
public int getResultsRequiredForPaging()
Calculate the number of results that would be required to satisy this paging request. Note that the skip size can significantly increase this number even if the page sizes are small.- Returns:
- the number of results required for proper paging
-
-