public final class Operand extends java.lang.Object implements java.lang.Iterable<Operand>, ExpressionOwner
Constructor and Description |
---|
Operand(Expression parentExpression,
Expression childExpression,
OperandRole role)
Create an operand object
|
Modifier and Type | Method and Description |
---|---|
void |
detachChild() |
Expression |
getChildExpression()
Get the expression used as the actual operand
|
OperandRole |
getOperandRole()
Get the operand role
|
Expression |
getParentExpression()
Get the parent expression of this operand
|
SequenceType |
getRequiredType()
Get the required type of the operand
|
OperandUsage |
getUsage()
Get the usage of the operand
|
boolean |
hasSameFocus()
Ask whether the child expression is evaluated with the same focus as its parent expression
|
boolean |
isEvaluatedRepeatedly()
Ask whether the operand is a higher-order operand, in the sense that the child expression
is evaluated repeatedly during a single evaluation of the parent expression
|
boolean |
isInChoiceGroup()
Ask whether the operand is a member of a choice group
|
java.util.Iterator<Operand> |
iterator()
Get a singleton iterator that returns this operand only
|
void |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo) |
void |
setChildExpression(Expression childExpression)
Change the child expression used for this operand.
|
void |
setOperandRole(OperandRole role)
Set the operand role
|
boolean |
setsNewFocus()
Ask whether the child expression sets a new focus for evaluation of other operands
|
void |
setUsage(OperandUsage usage)
Set the usage of the operand
|
void |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo) |
static OperandUsage |
typeDeterminedUsage(ItemType type) |
public Operand(Expression parentExpression, Expression childExpression, OperandRole role)
parentExpression
- the expression of which this is an operandchildExpression
- the actual expression used as the operandrole
- information about the role this operand plays within the parent expressionpublic Expression getParentExpression()
public Expression getChildExpression()
public void setChildExpression(Expression childExpression)
setChildExpression
in interface ExpressionOwner
childExpression
- the new child expressionpublic void detachChild()
public OperandRole getOperandRole()
public void setOperandRole(OperandRole role)
role
- the operand rolepublic boolean setsNewFocus()
public boolean hasSameFocus()
public boolean isEvaluatedRepeatedly()
public OperandUsage getUsage()
public void setUsage(OperandUsage usage)
usage
- the operand usagepublic SequenceType getRequiredType()
public boolean isInChoiceGroup()
public java.util.Iterator<Operand> iterator()
iterator
in interface java.lang.Iterable<Operand>
public void typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
XPathException
public void optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
XPathException
public static OperandUsage typeDeterminedUsage(ItemType type)
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.