Package org.alfresco.query
Class CannedQueryPageDetails
- java.lang.Object
-
- org.alfresco.query.CannedQueryPageDetails
-
public class CannedQueryPageDetails extends java.lang.Object
Details for canned queries supporting paged results. Results areskipped
, chopped into pages ofappropriate size
before thestart page
andnumber
are returned.- Since:
- 4.0
- Author:
- Derek Hulley
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PAGE_COUNT
static int
DEFAULT_PAGE_NUMBER
static int
DEFAULT_PAGE_SIZE
static int
DEFAULT_SKIP_RESULTS
-
Constructor Summary
Constructors Constructor Description CannedQueryPageDetails()
Construct 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPageCount()
Get the total number of pages to returnint
getPageNumber()
Get the first page number to returnint
getPageSize()
Get the size of each pageint
getResultsRequiredForPaging()
Calculate the number of results that would be required to satisy this paging request.int
getSkipResults()
Get the number of query results to skip before applying further page parametersjava.lang.String
toString()
-
-
-
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
-
-