info.magnolia.cms.util
Class SiblingsHelper

java.lang.Object
  extended by info.magnolia.cms.util.SiblingsHelper

public class SiblingsHelper
extends java.lang.Object

A utility class to navigate amongst the siblings of a given node. This is not synchronized.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Method Summary
static SiblingsHelper childrenOf(Content parent)
          Instantiates a SiblingsHelper representing the children of the given node, where the current node is the first child of the same type as its parent.
static SiblingsHelper childrenOf(Content parent, Content.ContentFilter filter)
          Instantiates a SiblingsHelper representing the children of the given node, where the current node is the first child from all that pass the filter.
static SiblingsHelper childrenOf(Content parent, ItemType childType)
          Instantiates a SiblingsHelper representing the children of the given node, where the current node is the first child of given type.
 Content getCurrent()
           
 int getIndex()
          Returns the zero-based index of the current node.
 Content goTofirst()
           
 Content goTolast()
           
 boolean isFirst()
           
 boolean isLast()
           
 Content next()
           
static SiblingsHelper of(Content node)
          Instantiates a SiblingsHelper representing the siblings of the given node and of the same type.
 Content prev()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

of

public static SiblingsHelper of(Content node)
                         throws javax.jcr.RepositoryException
Instantiates a SiblingsHelper representing the siblings of the given node and of the same type.

Throws:
javax.jcr.RepositoryException

childrenOf

public static SiblingsHelper childrenOf(Content parent)
                                 throws javax.jcr.RepositoryException
Instantiates a SiblingsHelper representing the children of the given node, where the current node is the first child of the same type as its parent.

Throws:
javax.jcr.RepositoryException

childrenOf

public static SiblingsHelper childrenOf(Content parent,
                                        ItemType childType)
                                 throws javax.jcr.RepositoryException
Instantiates a SiblingsHelper representing the children of the given node, where the current node is the first child of given type.

Throws:
javax.jcr.RepositoryException

childrenOf

public static SiblingsHelper childrenOf(Content parent,
                                        Content.ContentFilter filter)
                                 throws javax.jcr.RepositoryException
Instantiates a SiblingsHelper representing the children of the given node, where the current node is the first child from all that pass the filter.

Throws:
javax.jcr.RepositoryException

next

public Content next()

prev

public Content prev()

goTofirst

public Content goTofirst()

goTolast

public Content goTolast()

getCurrent

public Content getCurrent()

getIndex

public int getIndex()
Returns the zero-based index of the current node.


isFirst

public boolean isFirst()

isLast

public boolean isLast()


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.