| java.lang.Object net.sf.saxon.expr.Optimizer
Optimizer | public class Optimizer implements Serializable(Code) | | This class doesn't actually do any optimization itself, despite the name. Rather, it is
intended to act as a factory for implementation classes that perform optimization, so that
the appropriate level of optimization can be selected.
|
Method Summary | |
public Expression | convertPathExpressionToKey(PathExpression pathExp, StaticContext env) Examine a path expression to see whether it can be replaced by a call on the key() function;
if so, generate an appropriate key definition and return the call on key(). | public FilterExpression | convertToFilterExpression(PathExpression pathExp, TypeHierarchy th) Convert a path expression such as a/b/c[predicate] into a filter expression
of the form (a/b/c)[predicate]. | public Configuration | getConfiguration() | public int | isIndexableFilter(Expression filter) Test whether a filter predicate is indexable. | public Closure | makeClosure(Expression expression, int ref) | public BinaryExpression | makeGeneralComparison(Expression p0, int op, Expression p1, boolean backwardsCompatible) | public Expression | optimizeCopy(Expression select) Attempt to optimize a copy operation. | public SequenceIterator | tryIndexedFilter(ValueRepresentation startValue, Expression filter, int isIndexable, XPathContext context) |
convertPathExpressionToKey | public Expression convertPathExpressionToKey(PathExpression pathExp, StaticContext env) throws XPathException(Code) | | Examine a path expression to see whether it can be replaced by a call on the key() function;
if so, generate an appropriate key definition and return the call on key(). If not, return null.
Parameters: pathExp - The path expression to be converted. |
convertToFilterExpression | public FilterExpression convertToFilterExpression(PathExpression pathExp, TypeHierarchy th) throws StaticError(Code) | | Convert a path expression such as a/b/c[predicate] into a filter expression
of the form (a/b/c)[predicate]. This is possible whenever the predicate is non-positional.
The conversion is useful in the case where the path expression appears inside a loop,
where the predicate depends on the loop variable but a/b/c does not.
Parameters: pathExp - the path expression to be converted the resulting filterexpression if conversion is possible, or null if not |
isIndexableFilter | public int isIndexableFilter(Expression filter)(Code) | | Test whether a filter predicate is indexable.
Parameters: filter - the predicate expression 0 if not indexable; +1 if the predicate is in the form expression=value; -1 if it is inthe form value=expression |
makeClosure | public Closure makeClosure(Expression expression, int ref)(Code) | | Make a Closure, given the expected reference count
|
optimizeCopy | public Expression optimizeCopy(Expression select) throws XPathException(Code) | | Attempt to optimize a copy operation. Return null if no optimization is possible.
Parameters: select - the expression that selects the items to be copied null if no optimization is possible, or an expression that does an optimizedcopy of these items otherwise |
|
|