Package bucket.core.actions
Class PaginationSupport<T>
java.lang.Object
bucket.core.actions.PaginationSupport<T>
- All Implemented Interfaces:
PaginationSupport<T>
- Direct Known Subclasses:
ManualTotalPaginationSupport,PaginationSupportAdaptor,UsernameToUserTranslatingPaginationSupport
Deprecated.
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
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.PaginationSupport(int pageSize) Deprecated.PaginationSupport(List<T> items, int pageSize) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiongetItems()Deprecated.intDeprecated.Returns the next start index.int[]Deprecated.Returns an array of start indexes for pages that appear after the current page If there are no further pages, null is returnedintDeprecated.Returns an end index for use in the UI.intDeprecated.Returns a start index for use in the UI.getPage()Deprecated.Returns a subset of the list of items passed in, based on startIndex and the page sizeintDeprecated.Returns the number of items available on the current page.intDeprecated.Returns the previous start index.int[]Deprecated.Returns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returnedintDeprecated.Returns the start index.intDeprecated.Always return the start index value, regardless of whether the pagination has any total.intgetTotal()Deprecated.Returns the total number of items in the listvoidDeprecated.voidsetPageSize(int pageSize) Deprecated.voidsetStartIndex(int startIndex) Deprecated.voidsetTotal(int total) Deprecated.
-
Field Details
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZEDeprecated.- See Also:
-
DEFAULT_COUNT_ON_EACH_PAGE
public static final int DEFAULT_COUNT_ON_EACH_PAGEDeprecated.- See Also:
-
-
Constructor Details
-
PaginationSupport
public PaginationSupport()Deprecated. -
PaginationSupport
public PaginationSupport(int pageSize) Deprecated. -
PaginationSupport
Deprecated.
-
-
Method Details
-
getItems
Deprecated. -
setItems
Deprecated. -
setStartIndex
public void setStartIndex(int startIndex) Deprecated. -
getNiceEndIndex
public int getNiceEndIndex()Deprecated.Description copied from interface:PaginationSupportReturns an end index for use in the UI. It returns the end index - 1- Specified by:
getNiceEndIndexin interfacePaginationSupport<T>- Returns:
- a nice end index
-
getStartIndex
public int getStartIndex()Deprecated.Returns the start index. If the start index exceeds the index of the last element, the index of the last element is returned. If the start index is less than 0, 0 is returned.- Specified by:
getStartIndexin interfacePaginationSupport<T>- Returns:
- the start index.
-
getStartIndexValue
public int getStartIndexValue()Deprecated.Always return the start index value, regardless of whether the pagination has any total.- Specified by:
getStartIndexValuein interfacePaginationSupport<T>- Returns:
- the start index value, regardless of whether the pagination has any total.
-
getNextStartIndex
public int getNextStartIndex()Deprecated.Returns the next start index. Returns -1 if we are on the last page (there is no next page).- Specified by:
getNextStartIndexin interfacePaginationSupport<T>- Returns:
- the next start index. Returns -1 if we are on the last page (there is no next page).
-
getPreviousStartIndex
public int getPreviousStartIndex()Deprecated.Returns the previous start index. Returns -1 if we are on the first page (there is no previous page).- Specified by:
getPreviousStartIndexin interfacePaginationSupport<T>- Returns:
- the previous start index. Returns -1 if we are on the first page (there is no previous page).
-
getNextStartIndexes
public int[] getNextStartIndexes()Deprecated.Description copied from interface:PaginationSupportReturns an array of start indexes for pages that appear after the current page If there are no further pages, null is returned- Specified by:
getNextStartIndexesin interfacePaginationSupport<T>- Returns:
- an array of start indexes for pages that appear after the current page
-
getPreviousStartIndexes
public int[] getPreviousStartIndexes()Deprecated.Description copied from interface:PaginationSupportReturns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returned- Specified by:
getPreviousStartIndexesin interfacePaginationSupport<T>- Returns:
- an array of start indexes for pages that appear before the current page
-
getNiceStartIndex
public int getNiceStartIndex()Deprecated.Description copied from interface:PaginationSupportReturns a start index for use in the UI. It returns the start index + 1- Specified by:
getNiceStartIndexin interfacePaginationSupport<T>- Returns:
- a nice start index
-
getPage
Deprecated.Returns a subset of the list of items passed in, based on startIndex and the page size- Specified by:
getPagein interfacePaginationSupport<T>- Returns:
- a subset of the list of items passed in, based on startIndex and the page size
-
getTotal
public int getTotal()Deprecated.Description copied from interface:PaginationSupportReturns the total number of items in the list- Specified by:
getTotalin interfacePaginationSupport<T>- Returns:
- total number of items in the list
-
setTotal
public void setTotal(int total) Deprecated. -
setPageSize
public void setPageSize(int pageSize) Deprecated. -
getPageSize
public int getPageSize()Deprecated.Description copied from interface:PaginationSupportReturns the number of items available on the current page.- Specified by:
getPageSizein interfacePaginationSupport<T>- Returns:
- the number of items available on the current page.
-
PaginationServiceinstead.