use of org.sirix.axis.PostOrderAxis in project sirix by sirixdb.
the class FMSE method getLabels.
/**
* Creates a flat list of all nodes by doing an in-order-traversal. NOTE: Since this is not a
* binary tree, we use post-order-traversal (wrong in paper). For each node type (element,
* attribute, text, comment, ...) there is a separate list.
*
* @param rtx {@link XdmNodeReadTrx} reference
* @param visitor {@link LabelFMSEVisitor} used to save node type/list
*/
private void getLabels(final XdmNodeReadTrx rtx, final LabelFMSEVisitor visitor) {
assert rtx != null;
assert visitor != null;
final long nodeKey = rtx.getNodeKey();
for (final AbstractAxis axis = new PostOrderAxis(rtx); axis.hasNext(); ) {
axis.next();
if (axis.getTrx().getNodeKey() == nodeKey) {
break;
}
axis.getTrx().acceptVisitor(visitor);
}
rtx.acceptVisitor(visitor);
}
Aggregations