Package org.midheaven.collections
Interface Page<T>
- Type Parameters:
T- type of the elements in the Page
public interface Page<T>
Represents a Page. A Page is a subset of a larget elements set.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> Page<S> empty()static <S> Page<S> from(int ordinal, int totalPagesCount, int totalItemsCount, int maximumItemsPerPageCount, Sequence<S> items) Creates an instance from the provided source.items()Performs items.default <R> Page<R> Performs map.intPerforms maximumItemsPerPageCount.intordinal()Performs ordinal.intReturns total Items Count.intReturns total Pages Count.
-
Method Details
-
empty
- Returns:
- an empty Page.
-
from
static <S> Page<S> from(int ordinal, int totalPagesCount, int totalItemsCount, int maximumItemsPerPageCount, Sequence<S> items) Creates an instance from the provided source.- Parameters:
ordinal- the ordinal valuetotalPagesCount- the totalPagesCount valuetotalItemsCount- the totalItemsCount valuemaximumItemsPerPageCount- the maximumItemsPerPageCount valueitems- the items value- Returns:
- the result of from
-
ordinal
int ordinal()Performs ordinal.- Returns:
- the result of ordinal
-
totalPagesCount
int totalPagesCount()Returns total Pages Count.- Returns:
- the result of totalPagesCount
-
totalItemsCount
int totalItemsCount()Returns total Items Count.- Returns:
- the result of totalItemsCount
-
maximumItemsPerPageCount
int maximumItemsPerPageCount()Performs maximumItemsPerPageCount.- Returns:
- the result of maximumItemsPerPageCount
-
items
Performs items.- Returns:
- the result of items
-
map
Performs map.- Parameters:
mapper- the mapper value- Returns:
- the result of map
-