/** * Create an iterator over the descendant axis * * @param doc the containing TinyTree * @param node the node whose descendants are required * @param nodeTest test to be satisfied by each returned node */ DescendantIteratorSansText(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { tree = doc; nextNodeNr = node.nodeNr; startDepth = doc.depth[nextNodeNr]; matcher = nodeTest.getMatcher(doc); }
/** * Create an iterator over the descendant axis * * @param doc the containing TinyTree * @param node the node whose descendants are required * @param nodeTest test to be satisfied by each returned node */ DescendantIterator(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { tree = doc; nextNodeNr = node.nodeNr; startDepth = doc.depth[nextNodeNr]; matcher = nodeTest.getMatcher(doc); }
/** * Create an iterator over the descendant axis * * @param doc the containing TinyTree * @param node the node whose descendants are required * @param nodeTest test to be satisfied by each returned node */ DescendantIteratorSansText(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { tree = doc; nextNodeNr = node.nodeNr; startDepth = doc.depth[nextNodeNr]; matcher = nodeTest.getMatcher(doc); }
/** * Create an iterator over the descendant axis * * @param doc the containing TinyTree * @param node the node whose descendants are required * @param nodeTest test to be satisfied by each returned node */ DescendantIterator(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { tree = doc; nextNodeNr = node.nodeNr; startDepth = doc.depth[nextNodeNr]; matcher = nodeTest.getMatcher(doc); }
/** * Create an iterator over the following axis * * @param doc the containing TinyTree * @param node the start node. If the actual start was an attribute or namespace node, this will * be the parent element of that attribute or namespace * @param nodeTest condition that all the returned nodes must satisfy * @param includeDescendants true if descendants of the start node are to be included. This will * be false if the actual start was an element node, true if it was an attribute or namespace node * (since the children of their parent follow the attribute or namespace in document order). */ public FollowingIterator(TinyTree doc, TinyNodeImpl node, NodeTest nodeTest, boolean includeDescendants) { tree = doc; test = nodeTest; startNode = node; this.includeDescendants = includeDescendants; this.matcher = nodeTest.getMatcher(doc); }
/** * Create an iterator over the following axis * * @param doc the containing TinyTree * @param node the start node. If the actual start was an attribute or namespace node, this will * be the parent element of that attribute or namespace * @param nodeTest condition that all the returned nodes must satisfy * @param includeDescendants true if descendants of the start node are to be included. This will * be false if the actual start was an element node, true if it was an attribute or namespace node * (since the children of their parent follow the attribute or namespace in document order). */ public FollowingIterator(TinyTree doc, TinyNodeImpl node, NodeTest nodeTest, boolean includeDescendants) { tree = doc; test = nodeTest; startNode = node; this.includeDescendants = includeDescendants; this.matcher = nodeTest.getMatcher(doc); }
/** * Create an iterator over the descendant axis * * @param doc the containing TinyTree * @param node the node whose descendants are required * @param nodeTest test to be satisfied by each returned node */ GraftingDescendantIterator(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { tree = doc; startNode = node; test = nodeTest; nextNodeNr = node.nodeNr; startDepth = doc.depth[nextNodeNr]; matcher = nodeTest.getMatcher(doc); // TODO: handle TextualElement nodes }
@Override public IntPredicate getMatcher(NodeVectorTree tree) { switch (operator) { case Token.UNION: return nodetest1.getMatcher(tree).or(nodetest2.getMatcher(tree)); case Token.INTERSECT: return nodetest1.getMatcher(tree).and(nodetest2.getMatcher(tree)); case Token.EXCEPT: return new IntExceptPredicate(nodetest1.getMatcher(tree), nodetest2.getMatcher(tree)); default: throw new IllegalArgumentException("Unknown operator in Combined Node Test"); } }
@Override public IntPredicate getMatcher(NodeVectorTree tree) { switch (operator) { case Token.UNION: return nodetest1.getMatcher(tree).or(nodetest2.getMatcher(tree)); case Token.INTERSECT: return nodetest1.getMatcher(tree).and(nodetest2.getMatcher(tree)); case Token.EXCEPT: return new IntExceptPredicate(nodetest1.getMatcher(tree), nodetest2.getMatcher(tree)); default: throw new IllegalArgumentException("Unknown operator in Combined Node Test"); } }
PrecedingSiblingIterator(TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { document = doc; document.ensurePriorIndex(); test = nodeTest; startNode = node; nextNodeNr = node.nodeNr; parentNode = node.parent; // doesn't matter if this is null (unknown) this.matcher = nodeTest.getMatcher(doc); }
PrecedingSiblingIterator(TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { document = doc; document.ensurePriorIndex(); test = nodeTest; startNode = node; nextNodeNr = node.nodeNr; parentNode = node.parent; // doesn't matter if this is null (unknown) this.matcher = nodeTest.getMatcher(doc); }
public PrecedingIterator(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest, boolean includeAncestors) { this.includeAncestors = includeAncestors; tree = doc; current = node; nextAncestorDepth = doc.depth[node.nodeNr] - 1; this.nodeTest = nodeTest; this.matcher = nodeTest.getMatcher(doc); matchesTextNodes = nodeTest.getUType().overlaps(UType.TEXT); }
public PrecedingIterator(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest, boolean includeAncestors) { this.includeAncestors = includeAncestors; tree = doc; current = node; nextAncestorDepth = doc.depth[node.nodeNr] - 1; this.nodeTest = nodeTest; this.matcher = nodeTest.getMatcher(doc); matchesTextNodes = nodeTest.getUType().overlaps(UType.TEXT); }
/** * Create an iterator over the descendant axis * * @param doc the containing TinyTree * @param node the node whose descendants are required * @param nodeTest test to be satisfied by each returned node */ GraftingDescendantIterator(/*@NotNull*/ TinyTree doc, /*@NotNull*/ TinyNodeImpl node, NodeTest nodeTest) { tree = doc; startNode = node; test = nodeTest; nextNodeNr = node.nodeNr; startDepth = doc.depth[nextNodeNr]; matcher = nodeTest.getMatcher(doc); includeTextNodes = nodeTest.getUType().overlaps(UType.TEXT); }
this.tree = tree; test = nodeTest; matcher = nodeTest == null ? IntSetPredicate.ALWAYS_TRUE : nodeTest.getMatcher(tree); startNode = node; this.getChildren = getChildren;
this.tree = tree; test = nodeTest; matcher = nodeTest == null ? IntSetPredicate.ALWAYS_TRUE : nodeTest.getMatcher(tree); startNode = node; this.getChildren = getChildren;