Package dev.aurelium.slate.inv.content
Class Pagination.Impl
java.lang.Object
dev.aurelium.slate.inv.content.Pagination.Impl
- All Implemented Interfaces:
Pagination
- Enclosing interface:
- Pagination
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.aurelium.slate.inv.content.Pagination
Pagination.Impl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToIterator(SlotIterator iterator) Adds all the current page items to the given iterator.first()Sets the current page to the first page.intgetPage()Gets the current page.Gets the items of the current page.booleanisFirst()Checks if the current page is the first page.booleanisLast()Checks if the current page is the last page.last()Sets the current page to the last page.next()Sets the current page to the next page, if the current page is already the last page, this do nothing.page(int page) Sets the current page.previous()Sets the current page to the previous page, if the current page is already the first page, this do nothing.setItems(ClickableItem... items) Sets all the items for this Pagination.setItemsPerPage(int itemsPerPage) Sets the maximum amount of items per page.
-
Constructor Details
-
Impl
public Impl()
-
-
Method Details
-
getPageItems
Description copied from interface:PaginationGets the items of the current page.
This returns an array of the size of the items per page.- Specified by:
getPageItemsin interfacePagination- Returns:
- the current page items
-
getPage
public int getPage()Description copied from interface:PaginationGets the current page.- Specified by:
getPagein interfacePagination- Returns:
- the current page
-
page
Description copied from interface:PaginationSets the current page.- Specified by:
pagein interfacePagination- Parameters:
page- the current page- Returns:
this, for chained calls
-
isFirst
public boolean isFirst()Description copied from interface:PaginationChecks if the current page is the first page.
This is equivalent to:page == 0- Specified by:
isFirstin interfacePagination- Returns:
trueif this page is the first page
-
isLast
public boolean isLast()Description copied from interface:PaginationChecks if the current page is the last page.
This is equivalent to:page == itemsCount / itemsPerPage- Specified by:
isLastin interfacePagination- Returns:
trueif this page is the last page
-
first
Description copied from interface:PaginationSets the current page to the first page.
This is equivalent to:page(0)- Specified by:
firstin interfacePagination- Returns:
this, for chained calls
-
previous
Description copied from interface:PaginationSets the current page to the previous page, if the current page is already the first page, this do nothing.- Specified by:
previousin interfacePagination- Returns:
this, for chained calls
-
next
Description copied from interface:PaginationSets the current page to the next page, if the current page is already the last page, this do nothing.- Specified by:
nextin interfacePagination- Returns:
this, for chained calls
-
last
Description copied from interface:PaginationSets the current page to the last page.
This is equivalent to:page(itemsCount / itemsPerPage)- Specified by:
lastin interfacePagination- Returns:
this, for chained calls
-
addToIterator
Description copied from interface:PaginationAdds all the current page items to the given iterator.- Specified by:
addToIteratorin interfacePagination- Parameters:
iterator- the iterator- Returns:
this, for chained calls
-
setItems
Description copied from interface:PaginationSets all the items for this Pagination.- Specified by:
setItemsin interfacePagination- Parameters:
items- the items- Returns:
this, for chained calls
-
setItemsPerPage
Description copied from interface:PaginationSets the maximum amount of items per page.- Specified by:
setItemsPerPagein interfacePagination- Parameters:
itemsPerPage- the maximum amount of items per page- Returns:
this, for chained calls
-