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 int
Deprecated.static final int
Deprecated. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.PaginationSupport
(int pageSize) Deprecated.PaginationSupport
(List<T> items, int pageSize) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiongetItems()
Deprecated.int
Deprecated.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 returnedint
Deprecated.Returns an end index for use in the UI.int
Deprecated.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 sizeint
Deprecated.Returns the number of items available on the current page.int
Deprecated.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 returnedint
Deprecated.Returns the start index.int
Deprecated.Always return the start index value, regardless of whether the pagination has any total.int
getTotal()
Deprecated.Returns the total number of items in the listvoid
Deprecated.void
setPageSize
(int pageSize) Deprecated.void
setStartIndex
(int startIndex) Deprecated.void
setTotal
(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:PaginationSupport
Returns an end index for use in the UI. It returns the end index - 1- Specified by:
getNiceEndIndex
in 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:
getStartIndex
in 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:
getStartIndexValue
in 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:
getNextStartIndex
in 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:
getPreviousStartIndex
in 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:PaginationSupport
Returns an array of start indexes for pages that appear after the current page If there are no further pages, null is returned- Specified by:
getNextStartIndexes
in 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:PaginationSupport
Returns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returned- Specified by:
getPreviousStartIndexes
in 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:PaginationSupport
Returns a start index for use in the UI. It returns the start index + 1- Specified by:
getNiceStartIndex
in 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:
getPage
in 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:PaginationSupport
Returns the total number of items in the list- Specified by:
getTotal
in 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:PaginationSupport
Returns the number of items available on the current page.- Specified by:
getPageSize
in interfacePaginationSupport<T>
- Returns:
- the number of items available on the current page.
-
PaginationService
instead.