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

Method add

basex-core/src/main/java/org/basex/data/Namespaces.java:336–346  ·  view source on GitHub ↗

Adds a single namespace for the specified PRE value. @param pre PRE value @param prefix prefix @param uri namespace URI @param data data reference @return ID of namespace URI

(final int pre, final byte[] prefix, final byte[] uri, final Data data)

Source from the content-addressed store, hash-verified

334 * @return ID of namespace URI
335 */
336 public int add(final int pre, final byte[] prefix, final byte[] uri, final Data data) {
337 final int prefId = prefixes.put(prefix), uriId = uris.put(uri);
338 NSNode nd = current.find(pre, data);
339 if(nd.pre() != pre) {
340 final NSNode child = new NSNode(pre);
341 nd.add(child);
342 nd = child;
343 }
344 nd.add(prefId, uriId);
345 return uriId;
346 }
347
348 /**
349 * Closes a namespace node.

Callers

nothing calls this directly

Calls 4

preMethod · 0.95
addMethod · 0.95
putMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected