Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action.util
Class Page

java.lang.Object
  extended by com.jivesoftware.forum.action.util.Page

public class Page
extends java.lang.Object

A class to represent a page in a paginator. Each page knows it's ordinal number in the list and its starting index of the items we're paginating.

This class is useful when showing a list of links to pages in a forum or thread:

The view should use the properties of this class to show the corrent page number and link:


Field Summary
static Page FIRST
           
 
Constructor Summary
Page()
          Default constructor - does nothing.
 
Method Summary
static Page getNext(Page page, int range)
          Returns a page with correct values to the page next to the given page.
 int getNumber()
          Returns the display number (ordinal number) of this page.
static Page getPrev(Page page, int range)
          Returns a page with correct values to the page previous to the given page.
 int getStart()
          Sets the starting index of the items we're paginating.
 void setNumber(int number)
          Sets the display number (ordinal number) of this page.
 void setStart(int start)
          Sets the starting index of the items we're paginating.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST

public static final Page FIRST
Constructor Detail

Page

public Page()
Default constructor - does nothing.

Method Detail

getNumber

public int getNumber()
Returns the display number (ordinal number) of this page.

Returns:
the display number of this page.

setNumber

public void setNumber(int number)
Sets the display number (ordinal number) of this page.

Parameters:
number - the display number of this page.

getStart

public int getStart()
Sets the starting index of the items we're paginating. For example, if we're paginating a list of threads and the user shows 15 threads per page then the starting indexes would be 0, 15, 30, 45,...

Returns:
the starting index of the items we're paginating.

setStart

public void setStart(int start)
Sets the starting index of the items we're paginating.

Parameters:
start - the starting ndex of the items we're paginating.

getPrev

public static Page getPrev(Page page,
                           int range)
Returns a page with correct values to the page previous to the given page.

Parameters:
page - the current page used to compute the previous page.
range - the number of items per page - used to compute the correct previous item index.
Returns:
a page with correct values to the page previous to the given page.

getNext

public static Page getNext(Page page,
                           int range)
Returns a page with correct values to the page next to the given page.

Parameters:
page - the current page used to compute the next page.
range - the number of items per page - used to compute the correct next item index.
Returns:
a page with correct values to the page next to the given page.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.