1 package net.sf.saxon.expr; 2 3 import net.sf.saxon.type.AtomicType; 4 import net.sf.saxon.trans.XPathException; 5 import net.sf.saxon.trans.StaticError; 6 import net.sf.saxon.Configuration; 7 import net.sf.saxon.om.SequenceIterator; 8 import net.sf.saxon.om.ValueRepresentation; 9 import net.sf.saxon.value.Closure; 10 import net.sf.saxon.value.MemoClosure; 11 12 import java.io.Serializable ; 13 14 19 public class Optimizer implements Serializable { 20 21 protected Configuration config; 22 23 public Optimizer(Configuration config) { 24 this.config = config; 25 } 26 27 public Configuration getConfiguration() { 28 return config; 29 } 30 31 34 35 public BinaryExpression makeGeneralComparison(Expression p0, int op, Expression p1, boolean backwardsCompatible) { 36 if (backwardsCompatible) { 37 return new GeneralComparison10(p0, op, p1); 38 } else { 39 return new GeneralComparison(p0, op, p1); 40 } 41 } 42 43 49 50 public Expression optimizeCopy(Expression select) throws XPathException { 51 if (select.getItemType() instanceof AtomicType) { 52 return select; 53 } 54 return null; 55 } 56 57 60 61 public Closure makeClosure(Expression expression, int ref) { 62 if (ref == 1) { 63 return new Closure(); 64 } else { 65 return new MemoClosure(); 66 } 67 } 68 69 74 75 public Expression convertPathExpressionToKey(PathExpression pathExp, StaticContext env) throws XPathException { 76 return null; 77 } 78 79 87 88 public FilterExpression convertToFilterExpression(PathExpression pathExp) throws StaticError { 89 return null; 90 } 91 92 public SequenceIterator tryIndexedFilter(ValueRepresentation startValue, Expression filter, 93 int isIndexable, XPathContext context) throws XPathException { 94 return null; 95 } 96 97 103 104 public int isIndexableFilter(Expression filter) { 105 return 0; 106 } 107 } 108 109 127 | Popular Tags |