public class PagerPaginationSupport<T> extends Object
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<T> |
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<T> |
getItems() |
int |
getNextIndex() |
int[] |
getNextStartIndexes() |
int |
getNiceStartIndex() |
List<T> |
getPage()
returns a subset of the list of items passed in, based on startIndex and the max result per page
|
int |
getPreviousIndex() |
int[] |
getPreviousStartIndexes() |
int |
getStartIndex() |
int |
getStartIndexValue()
Always return the start index value, regardless of whether the pagination has any total.
|
int |
getTotal() |
boolean |
isTryNext() |
void |
setItems(com.atlassian.user.search.page.Pager<T> items) |
void |
setStartIndex(int startIndex) |
void |
setTryNext(boolean tryNext) |
void |
skipTo(int indexPosition) |
public static int DEFAULT_COUNT_ON_EACH_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<T> getItems()
public void setItems(com.atlassian.user.search.page.Pager<T> items)
public void setStartIndex(int startIndex)
public int getEndIndex()
public int getStartIndex()
public int getStartIndexValue()
public int getNextIndex()
public int getPreviousIndex()
@Nullable public int[] getNextStartIndexes()
@Nullable public int[] getPreviousStartIndexes()
public int getNiceStartIndex()
@Nullable public List<T> getPage()
public int getTotal()
public void skipTo(int indexPosition)
public boolean isTryNext()
public void setTryNext(boolean tryNext)
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.