|
TagLib documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alweb.doff.util.Pagination
public class Pagination
Provides an utility class to handle pagination. This class can't be sent to views to display pagination tag. You can also use this class into your model classes in order to retrieve the items at correct indices.
The page index starts at 1 and goes to the page count. But item indices starts from 0 to item count - 1.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_ITEM_COUNT_PER_PAGE
The default max item count per page. |
| Constructor Summary | |
|---|---|
Pagination(int itemCount)
Constructs a new pagination object from the count of items. |
|
Pagination(Integer itemCount,
Integer maxItemCountPerPage)
Constructs a new pagination object from the count of items and the max item count in a page. |
|
| Method Summary | |
|---|---|
int |
getHighIndex()
Returns the high item index on the current page. |
int[] |
getIndices()
Returns an array of indices of items on current page. |
int |
getItemCount()
Returns the item count specified at constructor on at setter. |
int |
getItemCountAtPage()
Returns the item count on the current page. |
int |
getLowIndex()
Returns the low item index on the current page. |
int |
getMaxItemCountPerPage()
Returns the max visible item count in a page. |
int |
getPageCount()
Returns the page count of the pagination. |
int |
getPageIndex()
Returns the current page index. |
boolean |
isEmpty()
Determines if this pagination doesn't contain any item. |
boolean |
onFirstPage()
Determines if current page index is the first one. |
boolean |
onLastPage()
Determines if current page index is the last one. |
void |
setItemCount(Integer count)
Sets the item count of this pagination. |
void |
setMaxItemCountPerPage(Integer count)
Sets the max visible item count in a page. |
void |
setPageIndex(Integer index)
Sets the current page index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_ITEM_COUNT_PER_PAGE
| Constructor Detail |
|---|
public Pagination(int itemCount)
20. The page index will be set to 1.
DEFAULT_MAX_ITEM_COUNT_PER_PAGE
public Pagination(Integer itemCount,
Integer maxItemCountPerPage)
1.
| Method Detail |
|---|
public int getHighIndex()
getLowIndex(),
getItemCountAtPage()public int[] getIndices()
getLowIndex(),
getHighIndex(),
getItemCountAtPage()public int getItemCount()
setItemCount(Integer),
isEmpty()public int getItemCountAtPage()
0.
getMaxItemCountPerPage()public int getLowIndex()
getHighIndex()public int getMaxItemCountPerPage()
setMaxItemCountPerPage(Integer)public int getPageCount()
0.
public int getPageIndex()
public boolean isEmpty()
getItemCount()public boolean onFirstPage()
public boolean onLastPage()
public void setItemCount(Integer count)
getItemCount()public void setMaxItemCountPerPage(Integer count)
getMaxItemCountPerPage()public void setPageIndex(Integer index)
|
TagLib documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||