public class ReverseDescendantIterator extends java.lang.Object implements net.sf.saxon.tree.iter.AxisIterator
DescendantIterator in traversal order of the child nodes. In some cases it is useful
to iterate from last child backwards to the first one, for example in PrecedingIterator.| Modifier and Type | Field and Description |
|---|---|
private java.util.Queue<net.sf.saxon.om.NodeInfo> |
queue
Queue for sibling nodes.
|
private java.util.Deque<net.sf.saxon.om.NodeInfo> |
stack
Stack for child nodes, to represent them in reverse order.
|
| Constructor and Description |
|---|
ReverseDescendantIterator(net.sf.saxon.om.NodeInfo start)
Create an iterator over the "descendant" axis in reverse order.
|
| Modifier and Type | Method and Description |
|---|---|
net.sf.saxon.om.NodeInfo |
next()
Get the next item in the sequence.
|
private void |
pushToStack(net.sf.saxon.tree.iter.AxisIterator iterateAxis)
Pushes all children to the stack.
|
private final java.util.Queue<net.sf.saxon.om.NodeInfo> queue
private final java.util.Deque<net.sf.saxon.om.NodeInfo> stack
public ReverseDescendantIterator(net.sf.saxon.om.NodeInfo start)
start - the initial context node.private void pushToStack(net.sf.saxon.tree.iter.AxisIterator iterateAxis)
iterateAxis - AxisInfo.CHILD axis iterator.public net.sf.saxon.om.NodeInfo next()
next in interface net.sf.saxon.om.SequenceIteratornext in interface net.sf.saxon.tree.iter.AxisIteratornext in interface net.sf.saxon.tree.iter.UnfailingIteratorCopyright © 2001-2022. All Rights Reserved.