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

Method has

basex-core/src/main/java/org/basex/query/expr/path/Path.java:226–240  ·  view source on GitHub ↗
(final Flag... flags)

Source from the content-addressed store, hash-verified

224 }
225
226 @Override
227 public final boolean has(final Flag... flags) {
228 // Context dependency, positional access: only check root expression.
229 // Examples: text(); ./abc; position()/a
230 if(Flag.FCS.oneOf(flags) ||
231 Flag.CTX.oneOf(flags) && (root == null || root.has(Flag.CTX)) ||
232 Flag.POS.oneOf(flags) && root != null && root.has(Flag.POS)) return true;
233 // check remaining flags
234 final Flag[] flgs = Flag.remove(flags, Flag.POS, Flag.CTX);
235 if(flgs.length == 0) return false;
236 for(final Expr step : steps) {
237 if(step.has(flgs)) return true;
238 }
239 return root != null && root.has(flgs);
240 }
241
242 /**
243 * Tries to cast the specified step into an axis step.

Callers 4

indexMethod · 0.45
toUnionMethod · 0.45
inlineableMethod · 0.45
initMethod · 0.45

Calls 2

removeMethod · 0.95
oneOfMethod · 0.65

Tested by

no test coverage detected