1 package com.icl.saxon.tree; 2 import com.icl.saxon.om.NodeInfo; 3 import com.icl.saxon.pattern.NodeTest; 4 5 final class ChildEnumeration extends TreeEnumeration { 6 7 public ChildEnumeration(NodeImpl node, NodeTest nodeTest) { 8 super(node, nodeTest); 9 next = (NodeImpl)node.getFirstChild(); 10 while (!conforms(next)) { 11 step(); 12 } 13 } 14 15 protected void step() { 16 next = (NodeImpl)next.getNextSibling(); 17 } 18 19 public boolean isSorted() { 20 return true; 21 } 22 23 public boolean isPeer() { 24 return true; 25 } 26 27 30 31 public int getLastPosition() { 32 if (last>=0) return last; 33 ChildEnumeration enum = 34 new ChildEnumeration(start, nodeTest); 35 return enum.count(); 36 } 37 38 } 39 40 41 | Popular Tags |