Compoze Software, Inc.

portlets.compoze.groupware
Class Pagination


java.lang.Object

  |

  +--portlets.compoze.groupware.Pagination

All Implemented Interfaces:
java.io.Serializable

public class Pagination
extends java.lang.Object
implements java.io.Serializable

This class represents pagination information such as start and end indices and total count.

See Also:
Serialized Form

Constructor Summary
Pagination(int iItemsPerPage)
          Constructor.
 
Method Summary
 void dump()
          Dumps the pagination information to System.out.
 int getEndIndex()
          Gets the end index.
 int getFirstPageIndex()
          Gets the first page index.
 int getItemsPerPage()
          Gets the number of items per page of this pagination.
 int getLastPageIndex()
          Gets the last page index.
 int getNextPageIndex()
          Gets the next page index.
 int getPreviousPageIndex()
          Gets the previous page index.
 int getStartIndex()
          Gets the start index.
 int getTotalItemCount()
          Gets the total item count.
 void init(int iStartIndex, int iTotalItemCount)
          Initializes the pagination controls.
 boolean isFirstPage()
          Checks if this pagination is the first page.
 boolean isLastPage()
          Checks if this pagination is the last page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pagination


public Pagination(int iItemsPerPage)
Constructor.
Parameters:
iItemsPerPage - the number of items per page
Method Detail

init


public void init(int iStartIndex,
                 int iTotalItemCount)
Initializes the pagination controls.
Parameters:
iStartIndex - the start index
iTotalItemCount - the total number of items

getStartIndex


public int getStartIndex()
Gets the start index.
Returns:
the start index (1-based) (inclusive)

getEndIndex


public int getEndIndex()
Gets the end index.
Returns:
the end index (1-based) (inclusive)

getTotalItemCount


public int getTotalItemCount()
Gets the total item count.
Returns:
the total item count

isFirstPage


public boolean isFirstPage()
Checks if this pagination is the first page.
Returns:
true if this is the first page; false otherwise

isLastPage


public boolean isLastPage()
Checks if this pagination is the last page.
Returns:
true if this is the last page; false otherwise

getFirstPageIndex


public int getFirstPageIndex()
Gets the first page index.
Returns:
the index of the first page

getLastPageIndex


public int getLastPageIndex()
Gets the last page index.
Returns:
the index of the last page

getNextPageIndex


public int getNextPageIndex()
Gets the next page index.
Returns:
the index of the next page

getPreviousPageIndex


public int getPreviousPageIndex()
Gets the previous page index.
Returns:
the index of the previous page

getItemsPerPage


public int getItemsPerPage()
Gets the number of items per page of this pagination.
Returns:
the number of items per page

dump


public void dump()
Dumps the pagination information to System.out.

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.