@Immutable public interface Page
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_LIMIT
The default number of items to include on a Page.
|
static int |
DEFAULT_OFFSET
The default number of items to skip before adding items to a Page.
|
| Modifier and Type | Method and Description |
|---|---|
Page |
back()
Return the "previous"
Page, if possible. |
static Page |
first()
Return the first
Page |
static Page |
from(PageTree tree)
Return a
Page based on the parsed statement that produced the
PageTree. |
Page |
go(int page)
Jump to
page Page while keeping the same limit. |
int |
limit()
Return the maximum number of items on the page.
|
Page |
next()
Return the "next"
Page. |
static Page |
none()
Return a
Page that specifies no specific Page and implies that
all items in a result set should be included. |
static Page |
number(int number)
Return the
Page at number. |
static Page |
of(int skip,
int limit)
|
int |
offset()
Return the number of items to "skip" (inclusive) before adding items to
the page.
|
Page |
resize(int size)
Set this
Page to include up to size items with the
assumption that all previous pages contained size items. |
Page |
size(int size)
Set this
Page to include up to size items. |
static Page |
sized(int size)
Return the first
Page with size items. |
default int |
skip()
An alias for
offset(). |
static final int DEFAULT_LIMIT
static final int DEFAULT_OFFSET
static Page none()
Page that specifies no specific Page and implies that
all items in a result set should be included.Pagestatic Page from(PageTree tree)
Page based on the parsed statement that produced the
PageTree.tree - Pagestatic Page number(int number)
Page at number.number - number Pagestatic Page of(int skip, int limit)
skip - limit - static Page sized(int size)
Page with size items.size - Page with size itemsPage back()
Page, if possible. If this is already the
first Page, it is returned from this method.Page go(int page)
page Page while keeping the same limit.page - int limit()
limit items remaining in the data set.Page next()
Page.
This method returns a new Page whose skip/offset parameter is
advanced by this pagination's limit.
int offset()
Page resize(int size)
Page to include up to size items with the
assumption that all previous pages contained size items.
NOTE: This method recalculates all the items on the current page as if
all preceeding pages also had size items. If you want to modify
this page to include size without modifying the assumptions about
what was contained on previous pages, use the size(int) method.
size - Page size(int size)
Page to include up to size items.
NOTE: This method only modifies the current page size (e.g. adds/removes)
items instead of recalculating all the items on the current page as if
all preceding pages also had size items. If you want to modify
this page to include size items in a manner that assumes
preceding pages also contained size items, use the
resize(int) method.
size - default int skip()
offset().