@PublicApi public class PagerFilter<T> extends Object implements Serializable
Most other filters (which want paging ability) will extend this.
Modifier and Type | Field and Description |
---|---|
protected Collection<Page> |
pages |
Constructor and Description |
---|
PagerFilter() |
PagerFilter(int max) |
PagerFilter(int start,
int max) |
PagerFilter(PagerFilter old) |
Modifier and Type | Method and Description |
---|---|
List<Page> |
generatePages(Collection<T> items)
generates a collection of page objects which keep track of the pages for display
|
List<Page> |
generatePages(int itemCount)
generates a collection of page objects which keep track of the pages for display
|
List<T> |
getCurrentPage(List<T> itemsCol)
Gets the current page out of a list of objects.
|
int |
getEnd() |
int |
getMax() |
int |
getNextStart() |
protected Collection<Page> |
getPages() |
List<Page> |
getPages(Collection<T> itemsCol) |
List<Page> |
getPages(int itemCount) |
int |
getPageSize() |
int |
getPreviousStart() |
int |
getStart() |
static PagerFilter |
getUnlimitedFilter()
A pager that will return unlimited number of objects.
|
static PagerFilter |
newPageAlignedFilter(int index,
int max)
A pager that has its start aligned to the page containing the index.
|
List<Page> |
restrictPages(Collection<Page> pages,
int size)
Restrict the pagers to a certain number of pages on either side of the current page.
|
void |
setMax(int max) |
void |
setStart(int start) |
String |
toString() |
protected Collection<Page> pages
public PagerFilter()
public PagerFilter(PagerFilter old)
public PagerFilter(int max)
public PagerFilter(int start, int max)
public static PagerFilter getUnlimitedFilter()
Integer.MAX_VALUE
public static PagerFilter newPageAlignedFilter(int index, int max)
index
- the index of a result whose page you want the pager to start atmax
- the maximum number of results in a pageIllegalArgumentException
- if index is less than 0public List<T> getCurrentPage(List<T> itemsCol)
public List<Page> getPages(Collection<T> itemsCol)
protected Collection<Page> getPages()
public List<Page> generatePages(Collection<T> items)
items
- the items to be pagedpublic List<Page> generatePages(int itemCount)
itemCount
- the number of items to be pagedpublic List<Page> restrictPages(Collection<Page> pages, int size)
The number of pages to list is stored in PAGES_TO_LIST
.
public int getMax()
public int getPageSize()
public void setMax(int max)
public int getStart()
public void setStart(int start)
public int getEnd()
public int getNextStart()
public int getPreviousStart()
Copyright © 2002-2018 Atlassian. All Rights Reserved.