com.atlassian.user.search.page
Class MergedListPager<T>
java.lang.Object
com.atlassian.user.search.page.MergedListPager<T>
- All Implemented Interfaces:
- Pager<T>, Iterable<T>
public class MergedListPager<T>
- extends Object
- implements Pager<T>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentPager
public Pager<? extends T> currentPager
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Pager<T>
iterator
public Iterator<T> iterator()
- Description copied from interface:
Pager
- Use this if you want a typical iterator over the entire data.
- Specified by:
iterator in interface Pager<T>- Specified by:
iterator in interface Iterable<T>
- Returns:
- an iterator over all results. Note: calling this multiple times does not reset the iterator back to the first element, as DefaultPager itself does not do this.
getCurrentPage
public List<T> getCurrentPage()
- returns a list of results (up to the limit defined in PRELOAD_LIMIT).
if there is insufficient preloaded results in the first pager, it will go to the next pager and so on, until the
preload limit is reached or all pagers have been checked.
Calling this method will move the position of the iterator! (like skipTo() does)
Note: this will exhaust all the results in a pager before going to the next one. It does not loop through the preloaded results of each each pager passed in.
Note: the position in which we start pulling elements from in the iterator is set by skipTo()
- Specified by:
getCurrentPage in interface Pager<T>
- Returns:
- a single, preloaded page.
nextPage
public void nextPage()
- Specified by:
nextPage in interface Pager<T>
onLastPage
public boolean onLastPage()
- Specified by:
onLastPage in interface Pager<T>
skipTo
public void skipTo(int index)
throws PagerException
- Will run the index up to this point. Calling
Pager.getCurrentPage() will
then return a page holding this index.
- Specified by:
skipTo in interface Pager<T>
- Parameters:
index - the zero-based index in the result set to skip to
- Throws:
PagerException - - if the number of items in the backing data is exceeded by the index.
getIndex
public int getIndex()
- Specified by:
getIndex in interface Pager<T>
- Returns:
- the current index position of the pager
getIndexOfFirstItemInCurrentPage
public int getIndexOfFirstItemInCurrentPage()
- Specified by:
getIndexOfFirstItemInCurrentPage in interface Pager<T>
- Returns:
- the index of the first item in the current page, relative to the start of the set
Copyright © 2005-2009 Atlassian Software Systems Pty Ltd. All Rights Reserved.