com.googlecode.jbp.common.repository
Class Page

java.lang.Object
  extended by com.googlecode.jbp.common.repository.Page
All Implemented Interfaces:
Serializable

public final class Page
extends Object
implements Serializable

This class represents paging information for use in object repositories. The page is represented using the begin position and the length of the page.

Many object retrieval methods may use pagination. Page coordinates are thus passed as parameters to these methods. As these coordinates belong together, it's better to have one single argument representing the page concept than having two separate arguments.

A Page instance may be instantiated like this: Page.newPage().begin(30).length(10);

Author:
Yannick LOTH - yannick AT littlej.biz -
See Also:
Serialized Form

Method Summary
 boolean equals(Object obj)
           
 Page firstResult(int firstResultParam)
           
 int getFirstResult()
           
 int getMaxResults()
           
 int hashCode()
           
 Page maxResults(int maxResultsParam)
           
static Page newPage()
          Returns a new Page instance.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newPage

public static Page newPage()
Returns a new Page instance.

Returns:
Returns the new instance.

firstResult

public final Page firstResult(int firstResultParam)

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

getFirstResult

public final int getFirstResult()

getMaxResults

public final int getMaxResults()

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

maxResults

public final Page maxResults(int maxResultsParam)

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.