MCPcopy Create free account
hub / github.com/BaseXdb/basex / mergedAxis

Method mergedAxis

basex-core/src/main/java/org/basex/query/expr/path/Path.java:1098–1107  ·  view source on GitHub ↗

Returns a merged axis for a step preceded by a descendant-or-self step. @param expr step to test @return axis or null

(final Expr expr)

Source from the content-addressed store, hash-verified

1096 * @return axis or {@code null}
1097 */
1098 private static Axis mergedAxis(final Expr expr) {
1099 if(expr instanceof final Step step) {
1100 final Axis axis = step.axis;
1101 if(!step.mayBePositional()) {
1102 if(axis == CHILD || axis == DESCENDANT) return DESCENDANT;
1103 if(axis == DESCENDANT_OR_SELF) return DESCENDANT_OR_SELF;
1104 }
1105 }
1106 return null;
1107 }
1108
1109 /**
1110 * Returns the common merged axis of multiple expressions.

Callers 2

mergeStepMethod · 0.95
commonAxisMethod · 0.95

Calls 1

mayBePositionalMethod · 0.45

Tested by

no test coverage detected