/** * Test whether this node test is satisfied by a given node on a TinyTree. The node * must be a document, element, text, comment, or processing instruction node. * This method is provided * so that when navigating a TinyTree a node can be rejected without * actually instantiating a NodeInfo object. * * @param tree the TinyTree containing the node * @param nodeNr the number of the node within the TinyTree * @return true if the node matches the NodeTest, otherwise false */ public boolean matches(TinyTree tree, int nodeNr) { if (tree.getNodeKind(nodeNr) != Type.DOCUMENT) { return false; } return matches(tree.getNode(nodeNr)); }
/** * Test whether this node test is satisfied by a given node on a TinyTree. The node * must be a document, element, text, comment, or processing instruction node. * This method is provided * so that when navigating a TinyTree a node can be rejected without * actually instantiating a NodeInfo object. * * @param tree the TinyTree containing the node * @param nodeNr the number of the node within the TinyTree * @return true if the node matches the NodeTest, otherwise false */ public boolean matches(TinyTree tree, int nodeNr) { if (tree.getNodeKind(nodeNr) != Type.DOCUMENT) { return false; } return matches(tree.getNode(nodeNr)); }