use of net.sf.saxon.om.NodeInfo in project checkstyle by checkstyle.
the class FollowingIterator method next.
/**
* Get the next item in the sequence.
*
* @return the next Item. If there are no more nodes, return null.
*/
@Override
public NodeInfo next() {
NodeInfo result = null;
do {
if (descendantEnum != null) {
result = descendantEnum.next();
}
if (result == null && siblingEnum != null) {
result = siblingEnum.next();
if (result == null) {
siblingEnum = null;
} else {
descendantEnum = result.iterateAxis(AxisInfo.DESCENDANT);
}
}
if (result == null) {
final NodeInfo parent = ancestorEnum.next();
if (parent == null) {
break;
}
siblingEnum = parent.iterateAxis(AxisInfo.FOLLOWING_SIBLING);
}
} while (result == null);
return result;
}
use of net.sf.saxon.om.NodeInfo in project checkstyle by checkstyle.
the class ReverseListIterator method next.
/**
* Get the next item in the sequence.
*
* @return the next Item. If there are no more nodes, return null.
*/
@Override
public NodeInfo next() {
final NodeInfo result;
if (index == -1) {
result = null;
} else {
result = items.get(index);
index--;
}
return result;
}
Aggregations