bucket.core
Interface PaginationSupport<T>

Type Parameters:
T - - the type of the item
All Known Implementing Classes:
ListBuilderPaginationSupport, ManualTotalPaginationSupport, PagerPaginationSupport, PaginationSupport, UsernameToUserTranslatingPaginationSupport

public interface PaginationSupport<T>

Calculates the page values and indexes for a list of items


Method Summary
 int getNextStartIndex()
          Returns the next start index.
 int[] getNextStartIndexes()
          Returns an array of start indexes for pages that appear after the current page If there are no further pages, null is returned
 int getNiceEndIndex()
          Returns an end index for use in the UI.
 int getNiceStartIndex()
          Returns a start index for use in the UI.
 List<T> getPage()
          Returns a sub-list of items that are shown on the page.
 int getPageSize()
          Returns the number of items available on the current page.
 int getPreviousStartIndex()
          Returns the previous start index.
 int[] getPreviousStartIndexes()
          Returns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returned
 int getStartIndex()
          Returns the start index.
 int getStartIndexValue()
          Always return the start index value, regardless of whether the pagination has any total.
 int getTotal()
          Returns the total number of items in the list
 

Method Detail

getStartIndex

int getStartIndex()
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.

Returns:
the start index.

getNiceStartIndex

int getNiceStartIndex()
Returns a start index for use in the UI. It returns the start index + 1

Returns:
a nice start index

getTotal

int getTotal()
Returns the total number of items in the list

Returns:
total number of items in the list

getPage

List<T> getPage()
Returns a sub-list of items that are shown on the page.

Returns:
a sub-list of items that are available on the page.

getStartIndexValue

int getStartIndexValue()
Always return the start index value, regardless of whether the pagination has any total.

Returns:
the start index value, regardless of whether the pagination has any total.

getNextStartIndex

int getNextStartIndex()
Returns the next start index. Returns -1 if we are on the last page (there is no next page).

Returns:
the next start index. Returns -1 if we are on the last page (there is no next page).

getPreviousStartIndex

int getPreviousStartIndex()
Returns the previous start index. Returns -1 if we are on the first page (there is no previous page).

Returns:
the previous start index. Returns -1 if we are on the first page (there is no previous page).

getNextStartIndexes

int[] getNextStartIndexes()
Returns an array of start indexes for pages that appear after the current page If there are no further pages, null is returned

Returns:
an array of start indexes for pages that appear after the current page

getPreviousStartIndexes

int[] getPreviousStartIndexes()
Returns an array of start indexes for pages that appear before the current page If there are no preceding pages, null is returned

Returns:
an array of start indexes for pages that appear before the current page

getNiceEndIndex

int getNiceEndIndex()
Returns an end index for use in the UI. It returns the end index - 1

Returns:
a nice end index

getPageSize

int getPageSize()
Returns the number of items available on the current page.

Returns:
the number of items available on the current page.


Copyright © 2003–2015 Atlassian. All rights reserved.