it.openutils.hibernate.paging
Class PaginatedResultImpl<T>

java.lang.Object
  extended by it.openutils.hibernate.paging.PaginatedResultImpl<T>
All Implemented Interfaces:
PaginatedResult<T>, Serializable

public class PaginatedResultImpl<T>
extends Object
implements PaginatedResult<T>

Version:
$Id: PaginatedResultImpl.java 3499 2011-06-04 08:01:45Z fgiust $
Author:
fgiust
See Also:
Serialized Form

Constructor Summary
PaginatedResultImpl(int itemsPerPage, int pageNumberStartingFromOne, int totalSize)
           
 
Method Summary
 T getFirstResult()
          Returns the fist result if available, null otherwise.
 Collection<T> getItems()
          Gets an iterator over the results
 int getItemsPerPage()
          Gets the maximum number of results per page
 int getNumberOfPages()
          Gets the total number of pages
 int getPage()
          Gets the page number (1, 2, 3...)
 int getTotalSize()
          Gets the total number of results that would be retrieved without pagination.
 void setResults(Collection<T> results)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaginatedResultImpl

public PaginatedResultImpl(int itemsPerPage,
                           int pageNumberStartingFromOne,
                           int totalSize)
Parameters:
itemsPerPage -
pageNumberStartingFromOne -
totalSize -
Method Detail

getItemsPerPage

public int getItemsPerPage()
Gets the maximum number of results per page

Specified by:
getItemsPerPage in interface PaginatedResult<T>
Returns:
the maximum number of results per page

getPage

public int getPage()
Gets the page number (1, 2, 3...)

Specified by:
getPage in interface PaginatedResult<T>
Returns:
the page number (1, 2, 3...)

getTotalSize

public int getTotalSize()
Gets the total number of results that would be retrieved without pagination.

Specified by:
getTotalSize in interface PaginatedResult<T>
Returns:
the total number of results that would be retrieved without pagination.

getNumberOfPages

public int getNumberOfPages()
Gets the total number of pages

Specified by:
getNumberOfPages in interface PaginatedResult<T>
Returns:
total number of pages

getItems

public Collection<T> getItems()
Gets an iterator over the results

Specified by:
getItems in interface PaginatedResult<T>
Returns:
an iterator over the results

getFirstResult

public T getFirstResult()
Returns the fist result if available, null otherwise.

Specified by:
getFirstResult in interface PaginatedResult<T>
Returns:
the fist result if available, null otherwise.

setResults

public void setResults(Collection<T> results)


Copyright © 2005-2011 Openmind. All Rights Reserved.