info.joseluismartin.dao
Interface Paginator

All Known Implementing Classes:
Page

public interface Paginator

A interface for row data paginators.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)

Method Summary
 void addPaginatorListener(PaginatorListener listener)
          Add a PaginatorListner
 void firstPage()
          Go to first page
 int getCount()
           
 int getPage()
          Gets the current page number
 int getPageSize()
          get the page size, ie the number of records in one page
 int getStartIndex()
          get the startIndex, ie the number of the first record of this page
 int getTotalPages()
           
 boolean hasNext()
           
 boolean hasPage(int indexPage)
           
 boolean hasPrevious()
           
 void lastPage()
          Go to last page
 void nextPage()
          Go to next page
 void previousPage()
          Go to previous page
 void removePaginatorListener(PaginatorListener listener)
          Remove a PaginatorListener
 void setCount(int count)
          set the number of total records, ie the number of records in all pages
 void setPage(int indexPage)
          set the page number to index page if possible
 void setPageSize(int pageSize)
          Set the page size, ie, the number of records in one page
 

Method Detail

hasNext

boolean hasNext()
Returns:
true if there is records on next page

hasPrevious

boolean hasPrevious()
Returns:
true if there is records on previews page

hasPage

boolean hasPage(int indexPage)
Returns:
true if there is records on index page

setPage

void setPage(int indexPage)
set the page number to index page if possible

Parameters:
indexPage - the new page number

getPage

int getPage()
Gets the current page number

Returns:
the current page number

getCount

int getCount()
Returns:
the number of total records

getTotalPages

int getTotalPages()
Returns:
the number of pages

nextPage

void nextPage()
Go to next page


previousPage

void previousPage()
Go to previous page


lastPage

void lastPage()
Go to last page


firstPage

void firstPage()
Go to first page


getStartIndex

int getStartIndex()
get the startIndex, ie the number of the first record of this page

Returns:
the start index

setCount

void setCount(int count)
set the number of total records, ie the number of records in all pages

Parameters:
count - the number of total records

getPageSize

int getPageSize()
get the page size, ie the number of records in one page

Returns:
the page size

setPageSize

void setPageSize(int pageSize)
Set the page size, ie, the number of records in one page

Parameters:
pageSize - the page size

addPaginatorListener

void addPaginatorListener(PaginatorListener listener)
Add a PaginatorListner

Parameters:
listener - the PaginatorListener to add

removePaginatorListener

void removePaginatorListener(PaginatorListener listener)
Remove a PaginatorListener

Parameters:
listener - the PaginatorListener to remove


Copyright © 2012 JDAL. All Rights Reserved.