org.exoplatform.services.wcm.utils
Class PaginatedNodeIterator

java.lang.Object
  extended by org.exoplatform.commons.utils.PageList
      extended by org.exoplatform.services.wcm.utils.PaginatedNodeIterator
Direct Known Subclasses:
PaginatedQueryResult

public class PaginatedNodeIterator
extends org.exoplatform.commons.utils.PageList

Created by The eXo Platform SAS Author : Hoa Pham hoa.phamvu@exoplatform.com Oct 17, 2008


Field Summary
protected  java.util.List<javax.jcr.Node> nodes
          The nodes.
 
Fields inherited from class org.exoplatform.commons.utils.PageList
available_, availablePage_, currentListPage_, currentPage_, EMPTY_LIST
 
Constructor Summary
PaginatedNodeIterator(int pageSize)
          Instantiates a new paginated node iterator.
PaginatedNodeIterator(java.util.List<javax.jcr.Node> nodes, int pageSize)
          Instantiates a new paginated node iterator.
 
Method Summary
 void changePage(int page)
          Change page.
protected  void checkAndSetPosition(int page)
          Check and set current cursor position in iterator.
 java.util.List getAll()
           
 java.util.List getCurrentPageData()
          Retrieve the nodes of current page.
 java.util.List<javax.jcr.Node> getNodes()
          Gets the nodes.
 int getNodesPerPage()
          Retrieve the nodes per page.
 java.util.List getPage(int page)
           
 long getTotalNodes()
          Retrieve the total nodes.
 int getTotalPages()
          Retrieve the total pages.
protected  void populateCurrentPage(int page)
           
 void setNodes(java.util.List<javax.jcr.Node> nodes)
          Sets the nodes.
 
Methods inherited from class org.exoplatform.commons.utils.PageList
checkAndSetPage, currentPage, getAvailable, getAvailablePage, getCurrentPage, getFrom, getPageSize, getTo, setAvailablePage, setPageSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

protected java.util.List<javax.jcr.Node> nodes
The nodes.

Constructor Detail

PaginatedNodeIterator

public PaginatedNodeIterator(int pageSize)
Instantiates a new paginated node iterator.

Parameters:
pageSize - the page size

PaginatedNodeIterator

public PaginatedNodeIterator(java.util.List<javax.jcr.Node> nodes,
                             int pageSize)
Instantiates a new paginated node iterator.

Parameters:
pageSize - the page size
nodes - the nodes
Method Detail

getNodes

public java.util.List<javax.jcr.Node> getNodes()
Gets the nodes.

Returns:
the nodes

setNodes

public void setNodes(java.util.List<javax.jcr.Node> nodes)
Sets the nodes.

Parameters:
nodes - the nodes to set

populateCurrentPage

protected void populateCurrentPage(int page)
                            throws java.lang.Exception
Specified by:
populateCurrentPage in class org.exoplatform.commons.utils.PageList
Throws:
java.lang.Exception

getTotalPages

public int getTotalPages()
Retrieve the total pages.

Returns:
the total pages

getNodesPerPage

public int getNodesPerPage()
Retrieve the nodes per page.

Returns:
the nodes per page

getTotalNodes

public long getTotalNodes()
Retrieve the total nodes.

Returns:
the total nodes

getCurrentPageData

public java.util.List getCurrentPageData()
                                  throws java.lang.Exception
Retrieve the nodes of current page.

Returns:
the current page data
Throws:
java.lang.Exception - the exception

getPage

public java.util.List getPage(int page)
                       throws java.lang.Exception
Overrides:
getPage in class org.exoplatform.commons.utils.PageList
Throws:
java.lang.Exception

changePage

public void changePage(int page)
                throws java.lang.Exception
Change page.

Parameters:
page - the page
Throws:
java.lang.Exception - the exception

checkAndSetPosition

protected void checkAndSetPosition(int page)
Check and set current cursor position in iterator.

Parameters:
page - the page

getAll

public java.util.List getAll()
                      throws java.lang.Exception
Specified by:
getAll in class org.exoplatform.commons.utils.PageList
Throws:
java.lang.Exception


Copyright © 2010 eXo Platform SAS. All Rights Reserved.