@Immutable public final class Page extends Object
| Modifier and Type | Method and Description |
|---|---|
Page |
back()
Return the "previous"
Page, if possible. |
boolean |
equals(Object obj) |
static Page |
first()
Return the first
Page |
Page |
go(int page)
Jump to
page Page while keeping the same limit. |
int |
hashCode() |
int |
limit()
Return the maximum number of items on the page.
|
Page |
next()
Return the "next"
Page. |
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. |
int |
skip()
An alias for
offset(). |
public static Page number(int number)
Page at number.number - number Pagepublic static Page of(int skip, int limit)
skip - limit - public static Page sized(int size)
Page with size items.size - Page with size itemspublic Page back()
Page, if possible. If this is already the
first Page, it is returned from this method.public Page go(int page)
page Page while keeping the same limit.page - public int limit()
limit items remaining in the data set.public Page next()
Page.
This method returns a new Page whose skip/offset parameter is
advanced by this pagination's limit.
public int offset()
public 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 - public 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 preceeding 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 - public int skip()
offset().