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

Method add

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

Adds the specified node into the child array, which is sorted by PRE values. @param node child node

(final NSNode node)

Source from the content-addressed store, hash-verified

204 * @param node child node
205 */
206 void add(final NSNode node) {
207 if(size == nodes.length) nodes = Array.copy(nodes, new NSNode[Array.newCapacity(size)]);
208
209 // find inserting position
210 int i = find(node.pre);
211 if(i < 0 || node.pre != nodes[i].pre) i++;
212
213 Array.insert(nodes, i, 1, size++, null);
214 nodes[i] = node;
215 node.parent = this;
216 }
217
218 /**
219 * Adds the specified prefix and URI reference.

Callers 2

openMethod · 0.95
addMethod · 0.95

Calls 5

copyMethod · 0.95
newCapacityMethod · 0.95
findMethod · 0.95
insertMethod · 0.95
copyOfMethod · 0.80

Tested by

no test coverage detected