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

Method delete

basex-core/src/main/java/org/basex/index/resource/Docs.java:182–196  ·  view source on GitHub ↗

Deletes the specified entry and updates subsequent nodes. @param pre PRE value @param size number of deleted nodes

(final int pre, final int size)

Source from the content-addressed store, hash-verified

180 * @param size number of deleted nodes
181 */
182 void delete(final int pre, final int size) {
183 // find insertion offset
184 final IntList docs = docs();
185 final int doc = docs.sortedIndexOf(pre);
186
187 // PRE value points to a document node...
188 if(doc >= 0) {
189 if(pathIndex) paths().remove(doc);
190 docs.remove(doc);
191 }
192
193 // adjust PRE values of following document nodes
194 docs.incFrom(-size, doc < 0 ? -doc - 1 : doc);
195 update();
196 }
197
198 /**
199 * Updates the index after a document has been renamed.

Callers

nothing calls this directly

Calls 7

docsMethod · 0.95
sortedIndexOfMethod · 0.95
pathsMethod · 0.95
removeMethod · 0.95
incFromMethod · 0.95
updateMethod · 0.95
removeMethod · 0.65

Tested by

no test coverage detected