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

Method insert

basex-core/src/main/java/org/basex/query/value/Value.java:154–160  ·  view source on GitHub ↗

Inserts a value at the given position. @param pos insertion position, must be between 0 and #size() @param value value to insert @param job interruptible job @return new value

(final long pos, final Value value, final Job job)

Source from the content-addressed store, hash-verified

152 * @return new value
153 */
154 public final Value insert(final long pos, final Value value, final Job job) {
155 final long size = size(), vsize = value.size();
156 return size == 0 ? value :
157 vsize == 0 ? this :
158 pos == size && size < vsize ? value.insertValue(0, this, job) :
159 insertValue(pos, value, job);
160 }
161
162 /**
163 * Inserts a value at the given position.

Callers 2

valueMethod · 0.95
appendMethod · 0.95

Calls 2

insertValueMethod · 0.95
sizeMethod · 0.65

Tested by

no test coverage detected