net.sf.saxon.tinytree
Class SiblingEnumeration

java.lang.Object
  extended by net.sf.saxon.om.AxisIteratorImpl
      extended by net.sf.saxon.tinytree.SiblingEnumeration
All Implemented Interfaces:
AtomizableIterator, AxisIterator, SequenceIterator

final class SiblingEnumeration
extends AxisIteratorImpl

This class supports both the child:: and following-sibling:: axes, which are identical except for the route to the first candidate node. It enumerates either the children or the following siblings of the specified node. In the case of children, the specified node must always be a node that has children: to ensure this, construct the enumeration using NodeInfo#getEnumeration()


Field Summary
 
Fields inherited from class net.sf.saxon.om.AxisIteratorImpl
current, last, position
 
Constructor Summary
protected SiblingEnumeration(TinyDocumentImpl doc, TinyNodeImpl node, NodeTest nodeTest, boolean getChildren)
          Return an enumeration over children or siblings of the context node
 
Method Summary
 SequenceIterator getAnother()
          Get another enumeration of the same nodes
 Item next()
          Get the next item in the sequence.
 
Methods inherited from class net.sf.saxon.om.AxisIteratorImpl
current, isAtomizing, position, setIsAtomizing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiblingEnumeration

protected SiblingEnumeration(TinyDocumentImpl doc,
                             TinyNodeImpl node,
                             NodeTest nodeTest,
                             boolean getChildren)
Return an enumeration over children or siblings of the context node

Parameters:
doc - The Document node containing the context node
node - The context node, the start point for the iteration
nodeTest - Test that the selected nodes must satisfy, or null indicating that all nodes are selected
getChildren - True if children of the context node are to be returned, false if following siblings are required
Method Detail

next

public Item next()
Description copied from interface: AxisIterator
Get the next item in the sequence.

Returns:
the next Item. If there are no more nodes, return null.

getAnother

public SequenceIterator getAnother()
Get another enumeration of the same nodes

Returns:
a new iterator over the same sequence