public class Optimizer
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config |
Constructor and Description |
---|
Optimizer(Configuration config) |
Modifier and Type | Method and Description |
---|---|
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().
|
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].
|
Configuration |
getConfiguration() |
int |
isIndexableFilter(Expression filter)
Test whether a filter predicate is indexable.
|
Closure |
makeClosure(Expression expression,
int ref)
Make a Closure, given the expected reference count
|
BinaryExpression |
makeGeneralComparison(Expression p0,
int op,
Expression p1,
boolean backwardsCompatible)
Create a GeneralComparison expression
|
Expression |
optimizeCopy(Expression select)
Attempt to optimize a copy operation.
|
SequenceIterator |
tryIndexedFilter(ValueRepresentation startValue,
Expression filter,
int isIndexable,
XPathContext context) |
ComputedExpression |
tryToConvertFilterExpressionToKey(FilterExpression f,
StaticContext env)
Try converting a filter expression to a call on the key function.
|
protected Configuration config
public Optimizer(Configuration config)
public Configuration getConfiguration()
public BinaryExpression makeGeneralComparison(Expression p0, int op, Expression p1, boolean backwardsCompatible)
public Expression optimizeCopy(Expression select) throws XPathException
select
- the expression that selects the items to be copiedXPathException
public Closure makeClosure(Expression expression, int ref)
public Expression convertPathExpressionToKey(PathExpression pathExp, StaticContext env) throws XPathException
pathExp
- The path expression to be converted.XPathException
public ComputedExpression tryToConvertFilterExpressionToKey(FilterExpression f, StaticContext env) throws XPathException
XPathException
public FilterExpression convertToFilterExpression(PathExpression pathExp, TypeHierarchy th) throws StaticError
pathExp
- the path expression to be convertedStaticError
public SequenceIterator tryIndexedFilter(ValueRepresentation startValue, Expression filter, int isIndexable, XPathContext context) throws XPathException
XPathException
public int isIndexableFilter(Expression filter)
filter
- the predicate expression