Adds the specified node into the child array, which is sorted by PRE values. @param node child node
(final NSNode node)
| 204 | * @param node child node |
| 205 | */ |
| 206 | void add(final NSNode node) { |
| 207 | if(size == nodes.length) nodes = Array.copy(nodes, new NSNode[Array.newCapacity(size)]); |
| 208 | |
| 209 | // find inserting position |
| 210 | int i = find(node.pre); |
| 211 | if(i < 0 || node.pre != nodes[i].pre) i++; |
| 212 | |
| 213 | Array.insert(nodes, i, 1, size++, null); |
| 214 | nodes[i] = node; |
| 215 | node.parent = this; |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Adds the specified prefix and URI reference. |