Finds the namespace node that is located closest to the specified PRE value. @param p PRE value @param data data reference @return node
(final int p, final Data data)
| 116 | * @return node |
| 117 | */ |
| 118 | NSNode find(final int p, final Data data) { |
| 119 | // return this node if the PRE values of all children are greater than the searched value |
| 120 | final int s = find(p); |
| 121 | if(s == -1) return this; |
| 122 | |
| 123 | final NSNode ch = nodes[s]; |
| 124 | final int cp = ch.pre; |
| 125 | // return exact hit |
| 126 | if(cp == p) return ch; |
| 127 | // found node is preceding sibling |
| 128 | if(cp + data.size(cp, Data.ELEM) <= p) return this; |
| 129 | // continue recursive search |
| 130 | return nodes[s].find(p, data); |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Locates a child node with the specified PRE value. |