public final class BasicPagination extends Object implements Pagination
Pagination.| Constructor and Description |
|---|
BasicPagination() |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Pagination |
first()
Sets the current page to the first page.
|
int |
getPage()
gets the current page.
|
@NotNull Icon[] |
getPageIcons()
gets the icons of the current page.
|
boolean |
isFirst()
checks if the current page is the first page.
|
boolean |
isLast()
checks if the current page is the last page.
|
@NotNull Pagination |
last()
sets the current page to the last page.
|
@NotNull Pagination |
next()
sets the current page to the next page,
if the current page is already the last page, this do nothing.
|
@NotNull Pagination |
page(int page)
sets the current page.
|
@NotNull Pagination |
previous()
sets the current page to the previous page,
if the current page is already the first page, this do nothing.
|
@NotNull Pagination |
setIcons(Icon... icons)
sets all the icons for this Pagination.
|
@NotNull Pagination |
setIconsPerPage(int iconsPerPage)
sets the maximum amount of icons per page.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddToIterator@NotNull public @NotNull Icon[] getPageIcons()
Paginationthis returns an array of the size of the icons per page.
getPageIcons in interface Paginationpublic int getPage()
PaginationgetPage in interface Pagination@NotNull public @NotNull Pagination page(int page)
Paginationpage in interface Paginationpage - the current page.this, for chained calls.public boolean isFirst()
Pagination
this is equivalent to: page == 0.
isFirst in interface Paginationtrue if this page is the first page.public boolean isLast()
Pagination
this is equivalent to: page == iconsCount / iconsPerPage.
isLast in interface Paginationtrue if this page is the last page.@NotNull public @NotNull Pagination first()
Pagination
this is equivalent to: page(0).
first in interface Paginationthis, for chained calls.@NotNull public @NotNull Pagination previous()
Paginationprevious in interface Paginationthis, for chained calls.@NotNull public @NotNull Pagination next()
Paginationnext in interface Paginationthis, for chained calls.@NotNull public @NotNull Pagination last()
Pagination
this is equivalent to: page(iconsCount / iconsPerPage).
last in interface Paginationthis, for chained calls.@NotNull public @NotNull Pagination setIcons(@NotNull Icon... icons)
PaginationsetIcons in interface Paginationicons - the icons.this, for chained calls.@NotNull public @NotNull Pagination setIconsPerPage(int iconsPerPage)
PaginationsetIconsPerPage in interface PaginationiconsPerPage - the maximum amount of icons per page.this, for chained calls.Copyright © 2021. All rights reserved.