Class Pagination<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.kamikazejam.kamicommon.menu.api.struct.paginated.Pagination<E>
- Type Parameters:
E- the object type to paginate
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>
Utility class to paginate a list of objects. Supports generic types to paginate any object type.
- See Also:
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionPagination(int pageSize) Pagination(int pageSize, E... objects) Pagination(int pageSize, Collection<E> objects) Pagination(int pageSize, List<E> objects) -
Method Summary
Modifier and TypeMethodDescriptionintfixPage(int page) getPage(int page) getPageSlots(int page) booleanisNextPage(int page) booleanisPrevious(int page) booleanpageExist(int page) intpageSize()intMethods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Constructor Details
-
Pagination
public Pagination(int pageSize) -
Pagination
-
Pagination
-
Pagination
-
-
Method Details
-
pageSize
public int pageSize() -
totalPages
public int totalPages() -
pageExist
public boolean pageExist(int page) - Parameters:
page- (0 indexed)
-
isNextPage
public boolean isNextPage(int page) -
isPrevious
public boolean isPrevious(int page) -
getPage
-
getPageSlots
-
fixPage
public int fixPage(int page)
-