1 package com.icl.saxon.expr; 2 import com.icl.saxon.*; 3 import com.icl.saxon.om.NodeEnumeration; 4 import java.util.*; 5 6 13 14 15 public class NodeListExpression extends NodeSetExpression { 16 17 private Expression baseExpression; 18 19 23 24 public NodeListExpression(Expression exp) { 25 baseExpression = exp; 26 } 27 28 32 33 public Expression simplify() throws XPathException { 34 baseExpression = baseExpression.simplify(); 35 if (baseExpression instanceof EmptyNodeSet) { 36 return baseExpression; 37 } else if (baseExpression instanceof SingletonNodeSet) { 38 return baseExpression; 39 } else { 40 return this; 41 } 42 } 43 44 49 50 public int getDependencies() { 51 return baseExpression.getDependencies(); 52 } 53 54 62 63 public Expression reduce(int dependencies, Context context) throws XPathException { 64 if ((getDependencies() & dependencies) != 0) { 65 return new NodeListExpression(baseExpression.reduce(dependencies, context)); 66 } else { 67 return this; 68 } 69 } 70 71 72 78 79 public NodeEnumeration enumerate(Context c, boolean sort) throws XPathException { 80 return baseExpression.enumerate(c, true); 81 } 82 83 86 87 public void display(int level) { 88 System.err.println(indent(level) + "NodeListExpression"); 89 baseExpression.display(level+1); 90 } 91 92 } 93 94 95 | Popular Tags |