com.ibatis.sqlmap.engine.mapping.statement
Class PaginatedDataList

java.lang.Object
  extended bycom.ibatis.sqlmap.engine.mapping.statement.PaginatedDataList
All Implemented Interfaces:
java.util.Collection, java.util.List, PaginatedList

public class PaginatedDataList
extends java.lang.Object
implements PaginatedList


Constructor Summary
PaginatedDataList(SqlMapExecutor sqlMapExecutor, java.lang.String statementName, java.lang.Object parameterObject, int pageSize)
           
 
Method Summary
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection c)
           
 java.lang.Object get(int index)
           
 int getPageIndex()
          Returns the current page index, which is a zero based integer.
 int getPageSize()
          Returns the maximum number of items per page
 void gotoPage(int pageNumber)
          Moves to a specified page.
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 boolean isFirstPage()
          Is the current page the first page?
 boolean isLastPage()
          Is the current page the last page?
 boolean isMiddlePage()
          Is the current page a middle page (ie not first or last)?
 boolean isNextPageAvailable()
          Is a page available after the current page?
 boolean isPreviousPageAvailable()
          Is a page available before the current page?
 java.util.Iterator iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 boolean nextPage()
          Moves to the next page after the current page.
 void pageTo(int idx)
           
 boolean previousPage()
          Moves to the page before the current page.
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 int size()
           
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

PaginatedDataList

public PaginatedDataList(SqlMapExecutor sqlMapExecutor,
                         java.lang.String statementName,
                         java.lang.Object parameterObject,
                         int pageSize)
                  throws java.sql.SQLException
Method Detail

pageTo

public void pageTo(int idx)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

nextPage

public boolean nextPage()
Description copied from interface: PaginatedList
Moves to the next page after the current page. If the current page is the last page, wrap to the first page.

Specified by:
nextPage in interface PaginatedList
Returns:
True if the page changed

previousPage

public boolean previousPage()
Description copied from interface: PaginatedList
Moves to the page before the current page. If the current page is the first page, wrap to the last page.

Specified by:
previousPage in interface PaginatedList
Returns:
True if the page changed

gotoPage

public void gotoPage(int pageNumber)
Description copied from interface: PaginatedList
Moves to a specified page. If the specified page is beyond the last page, wrap to the first page. If the specified page is before the first page, wrap to the last page.

Specified by:
gotoPage in interface PaginatedList
Parameters:
pageNumber - The page to go to

getPageSize

public int getPageSize()
Description copied from interface: PaginatedList
Returns the maximum number of items per page

Specified by:
getPageSize in interface PaginatedList
Returns:
The maximum number of items per page.

isFirstPage

public boolean isFirstPage()
Description copied from interface: PaginatedList
Is the current page the first page?

Specified by:
isFirstPage in interface PaginatedList
Returns:
True if the current page is the first page or if only a single page exists.

isMiddlePage

public boolean isMiddlePage()
Description copied from interface: PaginatedList
Is the current page a middle page (ie not first or last)?

Specified by:
isMiddlePage in interface PaginatedList
Returns:
True if the current page is not the first or last page, and more than one page exists (always returns false if only a single page exists).

isLastPage

public boolean isLastPage()
Description copied from interface: PaginatedList
Is the current page the last page?

Specified by:
isLastPage in interface PaginatedList
Returns:
True if the current page is the last page or if only a single page exists.

isNextPageAvailable

public boolean isNextPageAvailable()
Description copied from interface: PaginatedList
Is a page available after the current page?

Specified by:
isNextPageAvailable in interface PaginatedList
Returns:
True if the next page is available

isPreviousPageAvailable

public boolean isPreviousPageAvailable()
Description copied from interface: PaginatedList
Is a page available before the current page?

Specified by:
isPreviousPageAvailable in interface PaginatedList
Returns:
True if the previous page is available

size

public int size()
Specified by:
size in interface java.util.List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.List

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.List

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.List

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.List

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.List

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.List

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.List

clear

public void clear()
Specified by:
clear in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

getPageIndex

public int getPageIndex()
Description copied from interface: PaginatedList
Returns the current page index, which is a zero based integer. All paginated list implementations should know what index they are on, even if they don't know the ultimate boundaries (min/max).

Specified by:
getPageIndex in interface PaginatedList
Returns:
The current page