public class DefaultDynObjectPagingHelper extends AbstractDisposable implements DynObjectPagingHelper
DynObjectPagingHelper implementation.PagingCalculator.SizeableDEFAULT_PAGE_SIZE| Constructor and Description |
|---|
DefaultDynObjectPagingHelper() |
DefaultDynObjectPagingHelper(DynObjectSet set) |
DefaultDynObjectPagingHelper(DynObjectSet set,
int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
protected PagingCalculator |
getCalculator() |
long |
getCurrentPage()
Returns the number of the currently loaded page of data (zero
based).
|
DynObject[] |
getCurrentPageDynObjects()
Returns all the values of the current loaded page.
|
int |
getCurrentPageSize()
Returns the number of elements of the current page.
|
DynObject |
getDynObjectAt(long index)
Returns the
DynObject located at the index position. |
DynObjectSet |
getDynObjectSet()
Returns the
DynObjectSet used to fetch the data. |
long |
getInitialIndex()
Returns the index of the initial element of the current page into all the
elements.
|
int |
getMaxPageSize()
Returns the current maximum number of values per page.
|
long |
getNumPages()
Returns the number of pages available, calculated with the total number
of elements and the maximum number of elements per page.
|
long |
getTotalSize()
Returns the number of elements of the entire set of data.
|
protected void |
loadCurrentPageData() |
void |
reload()
Reloads everything.
|
void |
reloadCurrentPage()
Reloads the current page of data from the set.
|
protected void |
setCalculator(PagingCalculator calculator) |
void |
setCurrentPage(long page)
Sets the current page number (zero based), and loads the elements for
that page.
|
protected void |
setDefaultCalculator(PagingCalculator.Sizeable sizeable,
int pageSize) |
protected void |
setDynObjectSet(DynObjectSet set,
int pageSize) |
void |
setMaxPageSize(int pageSize)
Sets the current maximum number of elements per page.
|
dispose, disposepublic DefaultDynObjectPagingHelper()
public DefaultDynObjectPagingHelper(DynObjectSet set) throws BaseException
BaseExceptionpublic DefaultDynObjectPagingHelper(DynObjectSet set, int pageSize) throws BaseException
BaseExceptionprotected void setDynObjectSet(DynObjectSet set, int pageSize) throws BaseException
BaseExceptionpublic DynObject getDynObjectAt(long index) throws BaseException
DynObjectPagingHelperDynObject located at the index position.getDynObjectAt in interface DynObjectPagingHelperindex - to locate the DynObject in the setBaseException - if there is an error getting the DynObjectpublic DynObject[] getCurrentPageDynObjects()
DynObjectPagingHelpergetCurrentPageDynObjects in interface DynObjectPagingHelperpublic DynObjectSet getDynObjectSet()
DynObjectPagingHelperDynObjectSet used to fetch the data.getDynObjectSet in interface DynObjectPagingHelperpublic void reloadCurrentPage()
throws BaseException
DynObjectPagingHelperreloadCurrentPage in interface DynObjectPagingHelperBaseException - if there is an error reloading the current pageprotected void loadCurrentPageData()
throws BaseException
BaseExceptionpublic void reload()
throws BaseException
DynObjectPagingHelperreload in interface DynObjectPagingHelperBaseExceptionprotected void doDispose()
throws BaseException
AbstractDisposableAbstractDisposable.dispose() method, to be
implemented by child classes.doDispose in class AbstractDisposableBaseExceptionAbstractDisposable.dispose()protected PagingCalculator getCalculator()
protected void setCalculator(PagingCalculator calculator) throws BaseException
BaseExceptionprotected void setDefaultCalculator(PagingCalculator.Sizeable sizeable, int pageSize) throws BaseException
BaseExceptionpublic int getMaxPageSize()
PagingCalculatorgetMaxPageSize in interface PagingCalculatorpublic void setMaxPageSize(int pageSize)
throws BaseException
PagingCalculatorsetMaxPageSize in interface PagingCalculatorpageSize - the maximum number of values per pageBaseException - if there is an error reloading the current pagepublic long getCurrentPage()
PagingCalculatorgetCurrentPage in interface PagingCalculatorpublic void setCurrentPage(long page)
throws BaseException
PagingCalculatorsetCurrentPage in interface PagingCalculatorpage - the page to loadBaseException - if there is an error setting the current pagepublic long getInitialIndex()
PagingCalculatorgetInitialIndex in interface PagingCalculatorpublic long getNumPages()
PagingCalculatorgetNumPages in interface PagingCalculatorpublic long getTotalSize()
PagingCalculatorgetTotalSize in interface PagingCalculatorpublic int getCurrentPageSize()
PagingCalculatorgetCurrentPageSize in interface PagingCalculator