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

Method desc

basex-core/src/main/java/org/basex/index/path/PathIndex.java:157–166  ·  view source on GitHub ↗

Returns all children or descendants of the specified nodes. Called by the query parser and optimizer. @param nodes input nodes @param desc if false, return only children @return descendant nodes

(final ArrayList<PathNode> nodes, final boolean desc)

Source from the content-addressed store, hash-verified

155 * @return descendant nodes
156 */
157 public static ArrayList<PathNode> desc(final ArrayList<PathNode> nodes, final boolean desc) {
158 final ArrayList<PathNode> list = new ArrayList<>();
159 for(final PathNode node : nodes) {
160 for(final PathNode child : node.children) {
161 if(desc) child.addDesc(list);
162 else if(!list.contains(child)) list.add(child);
163 }
164 }
165 return list;
166 }
167
168 /**
169 * Returns all descendants with the specified element name.

Callers 6

checkAxisMethod · 0.95
pathNodesMethod · 0.95
getItemsMethod · 0.45
getCategoriesMethod · 0.45
addKeysMethod · 0.45
initMethod · 0.45

Calls 13

addMethod · 0.95
rootMethod · 0.95
createOrderMethod · 0.95
tokenMethod · 0.95
sortMethod · 0.95
addDescMethod · 0.80
containsMethod · 0.65
addMethod · 0.65
indexMethod · 0.65
sizeMethod · 0.65
getMethod · 0.65
startsWithMethod · 0.45

Tested by

no test coverage detected