static appendPageSize(url
:
URL, pageSize
:
Number)
:
URL
Returns an URL containing the page size parameter appended to the specified url.
appendPaging(url
:
URL)
:
URL
Returns an URL by appending the current page start position and the current page size to the URL.
appendPaging(url
:
URL, position
:
Number)
:
URL
Returns an URL by appending the paging parameters for a desired page start position and the current page size to the specified url.
getCount()
:
Number
Returns the count of the number of items in the model.
getEnd()
:
Number
Returns the index of the last element on the current page.
getPageElements()
:
Iterator
Returns an iterator that can be used to iterate through the elements of the current page.
getStart()
:
Number
Returns the current start position from which iteration will start.
isEmpty()
:
boolean
Identifies if the model is empty.
setStart(start
:
Number)
:
void
Sets the current start position from which iteration will start.
appendPageSize
Returns an URL containing the page size parameter appended to the
specified url. The name of the page size parameter is 'sz' (see
PAGE_SIZE_PARAMETER). The start position parameter is not appended to the
returned URL.
Parameters:
url
-
the URL to append the page size parameter to.
pageSize
-
the page size
Returns:
an URL that contains the page size parameter.
appendPaging
Returns an URL by appending the current page start position and the
current page size to the URL.
Parameters:
url
-
the URL to append the current paging position to.
Returns:
an URL containing the current paging position.
appendPaging
Returns an URL by appending the paging parameters for a desired
page start position and the current page size to the specified url. The name of
the page start position parameter is 'start' (see PAGING_START_PARAMETER)
and the page size parameter is 'sz' (see PAGE_SIZE_PARAMETER).
Parameters:
url
-
the URL to append the paging parameter to.
position
-
the start position.
Returns:
an URL that contains the paging parameters.
getCount
Returns the count of the number of items in the model.
Returns:
the count of the number of items in the model.
getCurrentPage
Returns the index number of the current page. The page
counting starts with 0. The method also works with a miss-aligned
start. In that case the start is always treated as the start of
a page.
Returns:
the index number of the current page.
getEnd
Returns the index of the last element on the current page.
Returns:
the index of the last element on the current page.
getMaxPage
Returns the maximum possible page number. Counting for pages starts
with 0. The method also works with a miss-aligned start. In that case
the returned number might be higher than ((count-1) / pageSize).
Returns:
the maximum possible page number.
getPageCount
Returns the total page count. The method also works
with a miss-aligned start. In that case the returned number might
be higher than (count / pageSize).
Returns:
the total page count.
getPageElements
Returns an iterator that can be used to iterate through the elements of
the current page.
In case of a collection as the page models source, the method can be
called multiple times. Each time a fresh iterator is returned.
In case of an iterator as the page models source, the method must be
called only once. The method will always return the same iterator,
which means the method amy return an exhausted iterator.
Returns:
an iterator that you use to iterate through the elements of the current page.
getPageSize
Returns the size of the page.
Returns:
the size of the page.
getStart
Returns the current start position from which iteration will start.
Returns:
the current start position from which iteration will start.
isEmpty
isEmpty()
:
boolean
Identifies if the model is empty.
Returns:
true if the model is empty, false otherwise.
setPageSize
setPageSize(pageSize
:
Number)
:
void
Sets the size of the page. The page size must be greater or
equal to 1.
Parameters:
pageSize
-
the size of the page.
setStart
setStart(start
:
Number)
:
void
Sets the current start position from which iteration will start.
Parameters:
start
-
the current start position from which iteration will start.