Package org.alfresco.query
Class CannedQueryPageDetails
java.lang.Object
org.alfresco.query.CannedQueryPageDetails
Details for canned queries supporting paged results.
Results are
skipped
, chopped into pages of
appropriate size
before the start page
and number
are returned.- Since:
- 4.0
- Author:
- Derek Hulley
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct with defaults skipResults:DEFAULT_SKIP_RESULTS
pageSize:DEFAULT_PAGE_SIZE
pageNumber:DEFAULT_PAGE_NUMBER
pageCount:DEFAULT_PAGE_COUNT
CannedQueryPageDetails
(int skipResults, int pageSize) Construct with defaults pageNumber:DEFAULT_PAGE_NUMBER
pageCount:DEFAULT_PAGE_COUNT
CannedQueryPageDetails
(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
Modifier and TypeMethodDescriptionint
Get the total number of pages to returnint
Get the first page number to returnint
Get the size of each pageint
Calculate the number of results that would be required to satisy this paging request.int
Get the number of query results to skip before applying further page parameterstoString()
-
Field Details
-
DEFAULT_SKIP_RESULTS
public static final int DEFAULT_SKIP_RESULTS- See Also:
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE- See Also:
-
DEFAULT_PAGE_NUMBER
public static final int DEFAULT_PAGE_NUMBER- See Also:
-
DEFAULT_PAGE_COUNT
public static final int DEFAULT_PAGE_COUNT- See Also:
-
-
Constructor Details
-
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
Helper constructor to transform a paging request into the Canned Query form.- Parameters:
pagingRequest
- the paging details
-
-
Method Details
-
toString
-
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
-