|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bucket.core.actions.PaginationSupport<T>
public class PaginationSupport<T>
Where there are a _very_ large number of items to paginate (in othe order of 10,000's), loading them all up in memory from the db and then handing them out to the user in a .subList fashion is not very efficient In this scenario we only want to use this bean to compute our next and previous indexes. Hence please use this bean in one of two ways (a) set _items_ on this bean and have the bean slice and dice up the uber collection for you and serve it to you with getPage() OR (b) set the total on this bean _only_ and leave the items _alone_. this is recommended for really large collections where its not ideal to load them all up.
Field Summary | |
---|---|
static int |
DEFAULT_COUNT_ON_EACH_PAGE
|
static int |
DEFAULT_PAGE_SIZE
|
Constructor Summary | |
---|---|
PaginationSupport()
|
|
PaginationSupport(int pageSize)
|
|
PaginationSupport(java.util.List<T> items,
int pageSize)
|
Method Summary | |
---|---|
int |
getCountOnEachPage()
Deprecated. since 3.0 (at least). Please use getPageSize() |
int |
getEndIndex()
Deprecated. since 3.0 (at least). Please use getNiceEndIndex() |
java.util.List<T> |
getItems()
|
int |
getNextIndex()
Deprecated. since 3.0 (at least). Please use getNextStartIndex() |
int |
getNextStartIndex()
Returns the next start index. |
int[] |
getNextStartIndexes()
Returns an array of start indexes for pages that appear after the current page If there are no further pages, null is returned |
int |
getNiceEndIndex()
Returns an end index for use in the UI. |
int |
getNiceStartIndex()
Returns a start index for use in the UI. |
java.util.List<T> |
getPage()
Returns a subset of the list of items passed in, based on startIndex and the page size |
int |
getPageSize()
Returns the number of items available on the current page. |
int |
getPreviousIndex()
Deprecated. since 3.0 (at least). Please use getPreviousStartIndex() |
int |
getPreviousStartIndex()
Returns the previous start index. |
int[] |
getPreviousStartIndexes()
Returns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returned |
int |
getStartIndex()
Returns the start index. |
int |
getStartIndexValue()
Always return the start index value, regardless of whether the pagination has any total. |
int |
getTotal()
Returns the total number of items in the list |
void |
setItems(java.util.List<T> items)
|
void |
setPageSize(int pageSize)
|
void |
setStartIndex(int startIndex)
|
void |
setTotal(int total)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DEFAULT_PAGE_SIZE
public static int DEFAULT_COUNT_ON_EACH_PAGE
Constructor Detail |
---|
public PaginationSupport()
public PaginationSupport(int pageSize)
public PaginationSupport(java.util.List<T> items, int pageSize)
Method Detail |
---|
@Deprecated public int getCountOnEachPage()
getPageSize()
public java.util.List<T> getItems()
public void setItems(java.util.List<T> items)
public void setStartIndex(int startIndex)
public int getNiceEndIndex()
PaginationSupport
getNiceEndIndex
in interface PaginationSupport<T>
@Deprecated public int getEndIndex()
getNiceEndIndex()
public int getStartIndex()
getStartIndex
in interface PaginationSupport<T>
public int getStartIndexValue()
getStartIndexValue
in interface PaginationSupport<T>
@Deprecated public int getNextIndex()
getNextStartIndex()
public int getNextStartIndex()
getNextStartIndex
in interface PaginationSupport<T>
@Deprecated public int getPreviousIndex()
getPreviousStartIndex()
public int getPreviousStartIndex()
getPreviousStartIndex
in interface PaginationSupport<T>
public int[] getNextStartIndexes()
PaginationSupport
getNextStartIndexes
in interface PaginationSupport<T>
public int[] getPreviousStartIndexes()
PaginationSupport
getPreviousStartIndexes
in interface PaginationSupport<T>
public int getNiceStartIndex()
PaginationSupport
getNiceStartIndex
in interface PaginationSupport<T>
public java.util.List<T> getPage()
getPage
in interface PaginationSupport<T>
public int getTotal()
PaginationSupport
getTotal
in interface PaginationSupport<T>
public void setTotal(int total)
public void setPageSize(int pageSize)
public int getPageSize()
PaginationSupport
getPageSize
in interface PaginationSupport<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |