com.atlassian.user.search.page
Class DefaultPager

java.lang.Object
  extended bycom.atlassian.user.search.page.DefaultPager
All Implemented Interfaces:
Pager

public class DefaultPager
extends java.lang.Object
implements Pager


Field Summary
 
Fields inherited from interface com.atlassian.user.search.page.Pager
EMPTY_PAGER, NO_POSITION, PRELOAD_LIMIT
 
Constructor Summary
DefaultPager()
           
DefaultPager(java.util.Collection col)
           
 
Method Summary
 java.util.List getCurrentPage()
           
 int getIndex()
           
 int getIndexOfFirstItemInCurrentPage()
          This pager always has all its items in a single page
 boolean hasNext()
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
          Use this if you want a typical iterator over the entire data.
 java.lang.Object next()
           
 void nextPage()
           
 boolean onLastPage()
           
 void remove()
           
 void skipTo(int index)
          Will run the index up to this point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPager

public DefaultPager()

DefaultPager

public DefaultPager(java.util.Collection col)
Method Detail

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Pager

iterator

public java.util.Iterator iterator()
Description copied from interface: Pager
Use this if you want a typical iterator over the entire data.

Specified by:
iterator in interface Pager
Returns:
an Iterator for the entire result set.

getCurrentPage

public java.util.List getCurrentPage()
Specified by:
getCurrentPage in interface Pager
Returns:
a single, preloaded page.

nextPage

public void nextPage()
Specified by:
nextPage in interface Pager

onLastPage

public boolean onLastPage()
Specified by:
onLastPage in interface Pager

skipTo

public void skipTo(int index)
            throws PagerException
Description copied from interface: Pager
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
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

public int getIndex()
Specified by:
getIndex in interface Pager
Returns:
the current index position of the pager

getIndexOfFirstItemInCurrentPage

public int getIndexOfFirstItemInCurrentPage()
This pager always has all its items in a single page

Specified by:
getIndexOfFirstItemInCurrentPage in interface Pager
Returns:
zero, because this pager has all its items in a single page

remove

public void remove()

hasNext

public boolean hasNext()

next

public java.lang.Object next()


Copyright © 2005-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.