1 package net.sf.saxon.tree; 2 import net.sf.saxon.om.SequenceIterator; 3 import net.sf.saxon.pattern.NodeTest; 4 5 final class AncestorEnumeration extends TreeEnumeration { 6 7 private boolean includeSelf; 8 9 public AncestorEnumeration(NodeImpl node, NodeTest nodeTest, boolean includeSelf) { 10 super(node, nodeTest); 11 this.includeSelf = includeSelf; 12 if (!includeSelf || !conforms(node)) { 13 advance(); 14 } 15 } 16 17 protected void step() { 18 next=(NodeImpl)next.getParent(); 19 } 20 21 24 25 public SequenceIterator getAnother() { 26 return new AncestorEnumeration(start, nodeTest, includeSelf); 27 } 28 } 29 30 31 32 | Popular Tags |