1 package com.icl.saxon.tree; 2 import com.icl.saxon.pattern.NodeTest; 3 4 final class AncestorEnumeration extends TreeEnumeration { 5 6 private boolean includeSelf; 7 8 public AncestorEnumeration(NodeImpl node, NodeTest nodeTest, boolean includeSelf) { 9 super(node, nodeTest); 10 this.includeSelf = includeSelf; 11 if (!includeSelf || !conforms(node)) { 12 advance(); 13 } 14 } 15 16 protected void step() { 17 next=(NodeImpl)next.getParent(); 18 } 19 20 23 24 public int getLastPosition() { 25 if (last>=0) return last; 26 AncestorEnumeration enum = 27 new AncestorEnumeration(start, nodeTest, includeSelf); 28 last = enum.count(); 29 return last; 30 } 31 } 32 33 34 35 | Popular Tags |