Deletes the specified entry and updates subsequent nodes. @param pre PRE value @param size number of deleted nodes
(final int pre, final int size)
| 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. |