public final class PaginationUtils extends Object
A set of utility methods to do pagination.
Modifier and Type | Method and Description |
---|---|
static int |
computeCurrentPage(int startIdx,
int productsPerPage) |
static int |
computeCurrentWindow(int currPage,
int pagesPerPage) |
static int |
computeEndIdx(int currPage,
int productsPerPage,
int totalProducts) |
static int |
computeMaxPage(int minPage,
int pagesPerPage,
int lastIdx,
int productsPerPage) |
static int |
computeMinPage(int pagesPerPage,
int currWindow) |
static int |
computeNextStartIdx(int maxPage,
int productsPerPage) |
static int |
computePrevStartIdx(int minPage,
int productsPerPage) |
static int |
getTotalPage(int numTotal,
int pageSize) |
static int |
getTotalPage(List originalList,
int pageSize) |
static int |
hasRemainder(int divisor,
int quotient) |
static List |
iterateFrom(int startIndex,
List originalList,
int pageSize) |
public static int hasRemainder(int divisor, int quotient)
public static int computeCurrentPage(int startIdx, int productsPerPage)
public static int computeCurrentWindow(int currPage, int pagesPerPage)
public static int computeMinPage(int pagesPerPage, int currWindow)
public static int computeMaxPage(int minPage, int pagesPerPage, int lastIdx, int productsPerPage)
public static int computeEndIdx(int currPage, int productsPerPage, int totalProducts)
public static int computePrevStartIdx(int minPage, int productsPerPage)
public static int computeNextStartIdx(int maxPage, int productsPerPage)
public static int getTotalPage(List originalList, int pageSize)
public static int getTotalPage(int numTotal, int pageSize)
Copyright © 1999–2017 Apache OODT. All rights reserved.