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. Use PaginationService 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 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 Details

    • DEFAULT_PAGE_SIZE

      public static final int DEFAULT_PAGE_SIZE
      Deprecated.
      See Also:
    • DEFAULT_COUNT_ON_EACH_PAGE

      public static final int DEFAULT_COUNT_ON_EACH_PAGE
      Deprecated.
      See Also:
  • Constructor Details

    • PaginationSupport

      public PaginationSupport()
      Deprecated.
    • PaginationSupport

      public PaginationSupport(int pageSize)
      Deprecated.
    • PaginationSupport

      public PaginationSupport(List<T> items, int pageSize)
      Deprecated.
  • Method Details

    • getItems

      public List<T> getItems()
      Deprecated.
    • setItems

      public void setItems(List<T> items)
      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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<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 interface PaginationSupport<T>
      Returns:
      the number of items available on the current page.