net.sf.saxon.expr
public class SlashExpression extends Expression implements ContextMappingFunction, ContextSwitchingExpression
Field Summary | |
---|---|
Expression | start |
Expression | step |
Constructor Summary | |
---|---|
SlashExpression(Expression start, Expression step)
Constructor |
Method Summary | |
---|---|
int | computeCardinality()
Determine the static cardinality of the expression |
int | computeDependencies()
Determine which aspects of the context the expression depends on. |
int | computeSpecialProperties()
Get the static properties of this expression (other than its type). |
Expression | copy()
Copy an expression. |
boolean | equals(Object other)
Is this expression the same as another expression? |
void | explain(ExpressionPresenter destination)
Diagnostic print of expression structure. |
Expression | getControlledExpression()
Get the step expression (the right-hand operand) |
Expression | getControllingExpression()
Get the start expression (the left-hand operand) |
Expression | getFirstStep()
Get the first step in this expression. |
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the items returned by this exprssion |
Expression | getLastStep()
Get the last step of the path expression |
Expression | getLeadingSteps()
Get a path expression consisting of all steps except the last |
Expression | getRemainingSteps()
Get all steps after the first.
|
int | hashCode()
get HashCode for comparing two expressions |
boolean | hasLoopingSubexpression(Expression child)
Given an expression that is an immediate child of this expression, test whether
the evaluation of the parent expression causes the child expression to be
evaluated repeatedly |
boolean | isHybrid()
Determine whether this expression is capable (as far as static analysis is concerned)
of returning a mixture of nodes and atomic values. |
SequenceIterator | iterate(XPathContext context)
Iterate the path-expression in a given context |
Iterator<Expression> | iterateSameFocusSubExpressions()
Get the immediate sub-expressions of this expression that are evaluated with the
same focus (context item, position, and size) as the parent expression. |
Iterator<Expression> | iterateSubExpressions()
Get the immediate subexpressions of this expression |
static SlashExpression | makeSlashExpression(Expression start, Expression step, TypeHierarchy th)
Static factory method, allowing early instantiation of a subclass if the type of the step expression
is already known |
SequenceIterator | map(XPathContext context)
Mapping function, from a node returned by the start iteration, to a sequence
returned by the child. |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
Expression | promote(PromotionOffer offer, Expression parent)
Promote this expression if possible |
protected Expression | promoteFocusIndependentSubexpressions(ExpressionVisitor visitor, ItemType contextItemType)
If any subexpressions within the step are not dependent on the focus,
and if they are not "creative" expressions (expressions that can create new nodes), then
promote them: this causes them to be evaluated once, outside the path expression |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
protected void | setStartExpression(Expression start2) |
protected void | setStepExpression(Expression step2) |
Expression | simplify(ExpressionVisitor visitor)
Simplify an expression |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression |
Parameters: start The left hand operand (which must always select a sequence of nodes). step The step to be followed from each node in the start expression to yield a new sequence; this may return either nodes or atomic values (but not a mixture of the two)
Returns: the copy of the original expression
Returns: the second operand
Returns: the first operand
Returns: the first step in the expression, after expanding any nested path expressions
Parameters: th the type hierarchy cache
Returns: the type of the step
Returns: the last step in the expression, after expanding any nested path expressions
Returns: a path expression containing all steps in this path expression other than the last, after expanding any nested path expressions
Returns: a path expression containing all steps in this path expression other than the first, after expanding any nested path expressions
Parameters: child the immediate subexpression
Returns: true if the child expression is evaluated repeatedly
Returns: true if the static type allows both nodes and atomic values
Parameters: context the evaluation context
Returns: an iterator containing those sub-expressions of this expression that are evaluated with the same focus as the parent expression
Parameters: visitor the expression visitor contextItemType the type of the context item for evaluating the start expression
Returns: the rewritten expression, or the original expression if no rewrite was possible
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: visitor the expression visitor
Returns: the simplified expression