Adds path nodes to the list if they comply with the given test conditions. @param node root node @param nodes output nodes @param name name ID, or 0 as wildcard @param kind node kind, or -1 for all types
(final PathNode node, final ArrayList<PathNode> nodes, final int name,
final int kind)
| 319 | * @param kind node kind, or {@code -1} for all types |
| 320 | */ |
| 321 | private void add(final PathNode node, final ArrayList<PathNode> nodes, final int name, |
| 322 | final int kind) { |
| 323 | |
| 324 | for(final PathNode pn : node.children) { |
| 325 | if(axis.oneOf(DESCENDANT, DESCENDANT_OR_SELF)) { |
| 326 | add(pn, nodes, name, kind); |
| 327 | } |
| 328 | if(kind == -1 && pn.kind != Data.ATTR ^ axis == ATTRIBUTE || |
| 329 | kind == pn.kind && (name == 0 || name == pn.name)) { |
| 330 | if(!nodes.contains(pn)) nodes.add(pn); |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * Checks if the step will never yield results. |