public class PromotionOffer extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
accepted
Flag that is set if the offer has been accepted, that is, if the expression has changed
|
int |
action
action is one of the possible promotion actions, FOCUS_INDEPENDENT, RANGE_INDEPENDENT,
EXTRACT_GLOBAL_VARIABLES
|
Binding[] |
bindingList
In the case of RANGE_INDEPENDENT, "binding" identifies the range variables whose dependencies
we are looking for.
|
Expression |
containingExpression
When a promotion offer is made, containingExpression identifies the level to which the promotion
should occur.
|
static int |
EXTRACT_GLOBAL_VARIABLES
EXTRACT_GLOBAL_VARIABLES identifies subexpressions that are not constant, but have no dependencies
other than on global variables or parameters (they must also be non-creative).
|
static int |
FOCUS_INDEPENDENT
FOCUS_INDEPENDENT requests promotion of all non-trivial subexpressions that don't depend on the
focus.
|
GlobalVariableManager |
globalVariableManager
In the case of EXTRACT_GLOBAL_VARIABLES, globalVariableManager is the set of global variables
to which any new global variables can be added
|
boolean |
promoteDocumentDependent
In the case of FOCUS_INDEPENDENT, "promoteDocumentDependent" is a boolean that, when set to
true, indicates that it is safe to promote a subexpression that depends on the context document
but not on other aspects of the focus.
|
boolean |
promoteXSLTFunctions
In the case of FOCUS_INDEPENDENT, "promoteXSLTFunctions" is a boolean that, when set to true, indicates
that it is safe to promote XSLT functions such as current().
|
static int |
RANGE_INDEPENDENT
RANGE_INDEPENDENT requests promotion of all non-trivial subexpressions that don't depend on a
specified range variable.
|
ExpressionVisitor |
visitor
The expression visitor in use
|
Constructor and Description |
---|
PromotionOffer(Optimizer optimizer)
Create a PromotionOffer for use with a particular Optimizer
|
Modifier and Type | Method and Description |
---|---|
Expression |
accept(Expression parent,
Expression child)
Method to test whether a subexpression qualifies for promotion, and if so, to
accept the promotion.
|
Optimizer |
getOptimizer()
Get the optimizer in use
|
public static final int FOCUS_INDEPENDENT
public static final int RANGE_INDEPENDENT
public static final int EXTRACT_GLOBAL_VARIABLES
public ExpressionVisitor visitor
public int action
public boolean promoteDocumentDependent
public boolean promoteXSLTFunctions
public GlobalVariableManager globalVariableManager
public Binding[] bindingList
public Expression containingExpression
public boolean accepted
public PromotionOffer(Optimizer optimizer)
optimizer
- the optimizerpublic Optimizer getOptimizer()
public Expression accept(Expression parent, Expression child) throws XPathException
parent
- child
- the subexpression in questionXPathException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.