use of org.sirix.axis.AbstractAxis 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);
}
use of org.sirix.axis.AbstractAxis in project sirix by sirixdb.
the class XPathParser method parseAbbrevForwardStep.
/**
* Parses the the rule AbrevForwardStep according to the following production rule:
* <p>
* [31] AbbrevForwardStep ::= "@"? NodeTest .
* </p>
*
* @return FilterAxis
*/
private AbstractAxis parseAbbrevForwardStep() {
AbstractAxis axis;
boolean isAttribute;
if (is(TokenType.AT, true) || mToken.getContent().equals("attribute") || mToken.getContent().equals("schema-attribute")) {
// in case of .../attribute(..), or .../schema-attribute() the
// default
// axis
// is the attribute axis
axis = new AttributeAxis(getTransaction());
isAttribute = true;
} else {
// default axis is the child axis
axis = new ChildAxis(getTransaction());
isAttribute = false;
}
final Filter filter = parseNodeTest(isAttribute);
return new FilterAxis(axis, filter);
}
Aggregations