@Immutable public interface Page
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_OFFSET
The default number of items to skip before adding items to a
Page. |
static int |
NO_LIMIT
Return the value that represents a
Page with no limit. |
| Modifier and Type | Method and Description |
|---|---|
Page |
back()
Return the "previous"
Page, if possible. |
static Page |
first()
Deprecated.
use
#skipLimit(int, int) instead |
static Page |
from(PageTree tree)
Return a
Page based on the parsed statement that produced the
PageTree. |
default Page |
go(int page)
Deprecated.
use
goTo(int) instead |
default Page |
goTo(int pageNumber)
|
default boolean |
hasLimit()
Return
true if this Page has an explicit limit. |
int |
limit()
Return the maximum number of items on the
Page. |
static Page |
limit(int size)
Return the first
Page with size items. |
Page |
next()
Return the "next"
Page. |
static Page |
none()
|
static Page |
number(int number)
Deprecated.
use
#skipLimit(int, int) instead |
static Page |
of(int skip,
int limit)
Deprecated.
use
#skipLimit(int, int) instead |
int |
offset()
Return the number of items to "skip" (inclusive) before adding items to
the
Page. |
static Page |
offset(int offset)
Return a
Page that results from skipping the specified number of
items. |
static Page |
offsetLimit(int offset,
int limit)
|
default Page |
previous()
Return the "previous"
Page, if possible. |
Page |
resize(int size)
Set this
Page to include up to size items. |
Page |
resizeAll(int size)
|
static Page |
sized(int size)
Deprecated.
use
limit(int) instead |
default int |
skip()
An alias for
offset(). |
static Page |
skip(int skip)
Return a
Page that results from skipping the specified number of
items. |
static Page |
skipLimit(int skip,
int limit)
|
static final int DEFAULT_OFFSET
Page.static final int NO_LIMIT
Page with no limit.@Deprecated static Page first()
#skipLimit(int, int) insteadPagePagestatic Page from(PageTree tree)
Page based on the parsed statement that produced the
PageTree.tree - the parsed PageTreePagestatic Page limit(int size)
Page with size items.size - the number of items per pagePage with size itemsstatic Page none()
Page that represents no specific Page and
implies that all items in a result set should be included.Page@Deprecated static Page number(int number)
#skipLimit(int, int) insteadPage at number.number - number Page@Deprecated static Page of(int skip, int limit)
#skipLimit(int, int) insteadskip - limit - static Page offset(int offset)
Page that results from skipping the specified number of
items.offset - the number of items to skip (0-indexed)Pagestatic Page offsetLimit(int offset, int limit)
offset - the number of items to skiplimit - the maximum number of items to returnPage@Deprecated static Page sized(int size)
limit(int) insteadPage with size items.size - Page with size itemsstatic Page skip(int skip)
Page that results from skipping the specified number of
items.skip - the number of items to skip (0-indexed)Pagestatic Page skipLimit(int skip, int limit)
skip - the number of items to skiplimit - the maximum number of items to returnPagePage back()
Page, if possible. If this is already the
first Page, it is returned from this method.Page@Deprecated default Page go(int page)
goTo(int) insteadpage Page while keeping the same limit.page - default Page goTo(int pageNumber)
Page, return the Page that
simulates jumping to the specified pageNumber.pageNumber - Pagedefault boolean hasLimit()
true if this Page has an explicit limit.int limit()
Page. The number of
items returned may be less than this value if there are fewer than
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.
Pageint offset()
Page.default Page previous()
Page, if possible. If this is already the
first Page, it is returned from this method.PagePage resize(int size)
Page to include up to size items.
NOTE: This method only modifies the current page size 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 resizeAll(int) method.
size - the new page sizePagePage resizeAll(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 preceding 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 resize(int) method.
size - the new page sizePagedefault int skip()
offset().