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 public class PaginationSupport<T> extends Object implements PaginationSupport<T>
Deprecated.since 6.10.0. UsePaginationService
instead.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 efficientIn 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
Fields Modifier and Type Field Description static int
DEFAULT_COUNT_ON_EACH_PAGE
Deprecated.static int
DEFAULT_PAGE_SIZE
Deprecated.
-
Constructor Summary
Constructors Constructor Description PaginationSupport()
Deprecated.PaginationSupport(int pageSize)
Deprecated.PaginationSupport(List<T> items, int pageSize)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<T>
getItems()
Deprecated.int
getNextStartIndex()
Deprecated.Returns the next start index.int[]
getNextStartIndexes()
Deprecated.Returns an array of start indexes for pages that appear after the current page If there are no further pages, null is returnedint
getNiceEndIndex()
Deprecated.Returns an end index for use in the UI.int
getNiceStartIndex()
Deprecated.Returns a start index for use in the UI.List<T>
getPage()
Deprecated.Returns a subset of the list of items passed in, based on startIndex and the page sizeint
getPageSize()
Deprecated.Returns the number of items available on the current page.int
getPreviousStartIndex()
Deprecated.Returns the previous start index.int[]
getPreviousStartIndexes()
Deprecated.Returns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returnedint
getStartIndex()
Deprecated.Returns the start index.int
getStartIndexValue()
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
setItems(List<T> items)
Deprecated.void
setPageSize(int pageSize)
Deprecated.void
setStartIndex(int startIndex)
Deprecated.void
setTotal(int total)
Deprecated.
-
-
-
Field Detail
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_COUNT_ON_EACH_PAGE
public static final int DEFAULT_COUNT_ON_EACH_PAGE
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public List<T> 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.
-
-