public class PagerPaginationSupport extends Object implements PaginationSupport
Pager
- which cannot report the total
size of the result. The Pager.getCurrentPage()
returns
a list of objects currently loaded in memory, which can return a List.size()
.
This number is imprecise, however, and is used as functional approximation. For various reasons explained
in the {#link Pager} javadoc, the only way to gain an accurate total size from a {#link Pager} is by using
its iterator and keeping count of each object.
If you have a regular, average sized list of items then use PaginationSupport
.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COUNT_ON_EACH_PAGE |
int[] |
nextStartIndexes |
List |
page |
Integer |
pagerSize |
int[] |
previousStartIndexes |
Constructor and Description |
---|
PagerPaginationSupport() |
PagerPaginationSupport(int countOnEachPage) |
Modifier and Type | Method and Description |
---|---|
int |
getCountOnEachPage() |
int |
getEndIndex() |
com.atlassian.user.search.page.Pager |
getItems() |
int |
getNextIndex() |
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 |
getPage()
returns a subset of the list of items passed in, based on startIndex and the max result per page
|
int |
getPageSize()
Returns the number of items available on the current page.
|
int |
getPreviousIndex() |
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
|
boolean |
isTryNext() |
void |
setItems(com.atlassian.user.search.page.Pager items) |
void |
setStartIndex(int startIndex) |
void |
setTryNext(boolean tryNext) |
void |
skipTo(int indexPosition) |
public static final int DEFAULT_COUNT_ON_EACH_PAGE
public List page
public Integer pagerSize
public int[] nextStartIndexes
public int[] previousStartIndexes
public PagerPaginationSupport()
public PagerPaginationSupport(int countOnEachPage)
public int getCountOnEachPage()
public com.atlassian.user.search.page.Pager getItems()
public void setItems(com.atlassian.user.search.page.Pager items)
public void setStartIndex(int startIndex)
public int getNiceEndIndex()
PaginationSupport
getNiceEndIndex
in interface PaginationSupport
public int getEndIndex()
public int getStartIndex()
PaginationSupport
getStartIndex
in interface PaginationSupport
public int getStartIndexValue()
getStartIndexValue
in interface PaginationSupport
public int getNextIndex()
public int getNextStartIndex()
PaginationSupport
getNextStartIndex
in interface PaginationSupport
public int getPreviousIndex()
public int getPreviousStartIndex()
PaginationSupport
getPreviousStartIndex
in interface PaginationSupport
public int[] getNextStartIndexes()
PaginationSupport
getNextStartIndexes
in interface PaginationSupport
public int[] getPreviousStartIndexes()
PaginationSupport
getPreviousStartIndexes
in interface PaginationSupport
public int getNiceStartIndex()
PaginationSupport
getNiceStartIndex
in interface PaginationSupport
public List getPage()
getPage
in interface PaginationSupport
public int getTotal()
PaginationSupport
getTotal
in interface PaginationSupport
public void skipTo(int indexPosition)
public boolean isTryNext()
public void setTryNext(boolean tryNext)
public int getPageSize()
PaginationSupport
getPageSize
in interface PaginationSupport
Copyright © 2003–2017 Atlassian. All rights reserved.