Class Paginator
java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.utils.Paginator
- Author:
- RoinujNosde
-
Constructor Summary
ConstructorsConstructorDescriptionPaginator(int sizePerPage, int totalElements) Paginator(int sizePerPage, @NotNull Collection<?> collection) -
Method Summary
Modifier and TypeMethodDescriptionintauthor: RoinujNosdeintauthor: RoinujNosdeintauthor: RoinujNosdeintauthor: RoinujNosdeintauthor: RoinujNosdebooleanbooleanbooleanisValidIndex(int index) booleannextPage()Increases the page number if there are elements to displaybooleanDecreases the page number if current > 0
-
Constructor Details
-
Paginator
public Paginator(int sizePerPage, int totalElements) -
Paginator
-
-
Method Details
-
getTotalElements
public int getTotalElements()author: RoinujNosde- Returns:
- the total elements
-
getSizePerPage
public int getSizePerPage()author: RoinujNosde- Returns:
- the size per page
-
getMinIndex
public int getMinIndex()author: RoinujNosde- Returns:
- the minimal index based on the current page
-
getMaxIndex
public int getMaxIndex()author: RoinujNosde- Returns:
- the max index based on the current page
-
getCurrentPage
public int getCurrentPage()author: RoinujNosde- Returns:
- the current page, starting at 0
-
nextPage
public boolean nextPage()Increases the page number if there are elements to displayauthor: RoinujNosde
-
hasNextPage
public boolean hasNextPage()- Returns:
- if there is a next page
-
previousPage
public boolean previousPage()Decreases the page number if current > 0author: RoinujNosde
-
hasPreviousPage
public boolean hasPreviousPage()- Returns:
- if there is a previous page
-
isValidIndex
public boolean isValidIndex(int index) - Parameters:
index- the index- Returns:
- if this index will not cause any IndexOutOfBoundsException
author: RoinujNosde
-