com.ibatis.common.util

Interface PaginatedList

public interface PaginatedList extends List

Deprecated: All paginated list features have been deprecated

Interface for lists that support paging
Method Summary
intgetPageIndex()
Returns the current page index, which is a zero based integer.
intgetPageSize()
Returns the maximum number of items per page
voidgotoPage(int pageNumber)
Moves to a specified page.
booleanisFirstPage()
Is the current page the first page?
booleanisLastPage()
Is the current page the last page?
booleanisMiddlePage()
Is the current page a middle page (ie not first or last)?
booleanisNextPageAvailable()
Is a page available after the current page?
booleanisPreviousPageAvailable()
Is a page available before the current page?
booleannextPage()
Moves to the next page after the current page.
booleanpreviousPage()
Moves to the page before the current page.

Method Detail

getPageIndex

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

Returns: The current page

getPageSize

public int getPageSize()
Returns the maximum number of items per page

Returns: The maximum number of items per page.

gotoPage

public void gotoPage(int pageNumber)
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.

Parameters: pageNumber The page to go to

isFirstPage

public boolean isFirstPage()
Is the current page the first page?

Returns: True if the current page is the first page or if only a single page exists.

isLastPage

public boolean isLastPage()
Is the current page the last page?

Returns: True if the current page is the last page or if only a single page exists.

isMiddlePage

public boolean isMiddlePage()
Is the current page a middle page (ie not first or last)?

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).

isNextPageAvailable

public boolean isNextPageAvailable()
Is a page available after the current page?

Returns: True if the next page is available

isPreviousPageAvailable

public boolean isPreviousPageAvailable()
Is a page available before the current page?

Returns: True if the previous page is available

nextPage

public boolean nextPage()
Moves to the next page after the current page. If the current page is the last page, wrap to the first page.

Returns: True if the page changed

previousPage

public boolean previousPage()
Moves to the page before the current page. If the current page is the first page, wrap to the last page.

Returns: True if the page changed

Copyright © 2011. All Rights Reserved.