Class DescendantIterator
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.xpath.iterators.DescendantIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,net.sf.saxon.om.SequenceIterator
,net.sf.saxon.tree.iter.AxisIterator
public class DescendantIterator extends Object implements net.sf.saxon.tree.iter.AxisIterator
Recursive-free implementation of the descendant axis iterator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DescendantIterator.StartWith
Enum defines starting node for iterator.
-
Field Summary
Fields Modifier and Type Field Description private net.sf.saxon.tree.iter.AxisIterator
descendantEnum
Descendant axis iterator.private Queue<net.sf.saxon.om.NodeInfo>
queue
Queue for sibling nodes.
-
Constructor Summary
Constructors Constructor Description DescendantIterator(net.sf.saxon.om.NodeInfo start, DescendantIterator.StartWith startWith)
Create an iterator over the "descendant" axis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.sf.saxon.om.NodeInfo
next()
Get the next item in the sequence.
-
-
-
Field Detail
-
descendantEnum
private net.sf.saxon.tree.iter.AxisIterator descendantEnum
Descendant axis iterator.
-
-
Constructor Detail
-
DescendantIterator
public DescendantIterator(net.sf.saxon.om.NodeInfo start, DescendantIterator.StartWith startWith)
Create an iterator over the "descendant" axis.- Parameters:
start
- the initial context node.startWith
- mode of the iterator, seeDescendantIterator.StartWith
.
-
-
Method Detail
-
next
public net.sf.saxon.om.NodeInfo next()
Get the next item in the sequence.- Specified by:
next
in interfacenet.sf.saxon.tree.iter.AxisIterator
- Specified by:
next
in interfacenet.sf.saxon.om.SequenceIterator
- Returns:
- the next Item. If there are no more nodes, return null.
-
-