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

Method find

basex-core/src/main/java/org/basex/data/NSNode.java:118–131  ·  view source on GitHub ↗

Finds the namespace node that is located closest to the specified PRE value. @param p PRE value @param data data reference @return node

(final int p, final Data data)

Source from the content-addressed store, hash-verified

116 * @return node
117 */
118 NSNode find(final int p, final Data data) {
119 // return this node if the PRE values of all children are greater than the searched value
120 final int s = find(p);
121 if(s == -1) return this;
122
123 final NSNode ch = nodes[s];
124 final int cp = ch.pre;
125 // return exact hit
126 if(cp == p) return ch;
127 // found node is preceding sibling
128 if(cp + data.size(cp, Data.ELEM) <= p) return this;
129 // continue recursive search
130 return nodes[s].find(p, data);
131 }
132
133 /**
134 * Locates a child node with the specified PRE value.

Callers 8

rootMethod · 0.95
deleteMethod · 0.95
addMethod · 0.95
uriIdForPrefixMethod · 0.45
valuesMethod · 0.45
addNodesMethod · 0.45
addMethod · 0.45
deleteMethod · 0.45

Calls 1

sizeMethod · 0.65

Tested by

no test coverage detected