com.atlassian.user.search.page
Interface Pager<T>

All Superinterfaces:
Iterable<T>
All Known Implementing Classes:
AbstractLDAPPager, AbstractPrefetchingPager, DefaultPager, LDAPEntityPager, LDAPListOfGroupsPager, LDAPMembershipToUsernamePager, LDAPSingleStringPager, MergedListPager, MergedPager

public interface Pager<T>
extends Iterable<T>


Field Summary
static Pager EMPTY_PAGER
           
static int NO_POSITION
           
static int PRELOAD_LIMIT
          Maximum number of elements to hold in memory at a given moment.
 
Method Summary
 List<T> getCurrentPage()
           
 int getIndex()
           
 int getIndexOfFirstItemInCurrentPage()
           
 boolean isEmpty()
           
 Iterator<T> iterator()
          Use this if you want a typical iterator over the entire data.
 void nextPage()
           
 boolean onLastPage()
           
 void skipTo(int index)
          Will run the index up to this point.
 

Field Detail

EMPTY_PAGER

static final Pager EMPTY_PAGER

PRELOAD_LIMIT

static final int PRELOAD_LIMIT
Maximum number of elements to hold in memory at a given moment.

See Also:
Constant Field Values

NO_POSITION

static final int NO_POSITION
See Also:
Constant Field Values
Method Detail

isEmpty

boolean isEmpty()

iterator

Iterator<T> iterator()
Use this if you want a typical iterator over the entire data.

Specified by:
iterator in interface Iterable<T>
Returns:
an Iterator for the entire result set.

getCurrentPage

List<T> getCurrentPage()
Returns:
a single, preloaded page.

nextPage

void nextPage()

onLastPage

boolean onLastPage()

skipTo

void skipTo(int index)
            throws PagerException
Will run the index up to this point. Calling getCurrentPage() will then return a page holding this index.

Parameters:
index - the zero-based index of the item to skip to.
Throws:
PagerException - - if the number of items in the backing data is exceeded by the index.

getIndex

int getIndex()
Returns:
the current index position of the pager

getIndexOfFirstItemInCurrentPage

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