|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression com.saxonica.extra.SwitchExpression
public class SwitchExpression
An optimized Choose expression in which all the branches are tests of the same expression for equality with some value.
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
---|---|
SwitchExpression(Expression subject,
Map map,
Expression defaultAction,
StringCollator collation)
Create a switch expression |
Method Summary | |
---|---|
Expression |
copy()
Copy an expression. |
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible. |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Iterator |
iterateSubExpressions()
Get the immediate sub-expressions of this expression. |
void |
process(XPathContext context)
Process the instruction, without returning any tail calls |
Expression |
promote(PromotionOffer offer)
Offer promotion for this subexpression. |
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SwitchExpression(Expression subject, Map map, Expression defaultAction, StringCollator collation)
subject
- the value to be testedmap
- a map from possible values to the action to be performed on eachdefaultAction
- the expression to be evaluated if the value is not found in the mapMethod Detail |
---|
public Expression copy()
copy
in class Expression
public void explain(ExpressionPresenter out)
explain
in class Expression
out
- the expression presenter used to display the structurepublic ItemType getItemType(TypeHierarchy th)
This method should always return a result, though it may be the best approximation that is available at the time.
getItemType
in class Expression
th
- the type hierarchy cache
public Expression promote(PromotionOffer offer) throws XPathException
promote
in class Expression
offer
- details of the offer, for example the offer to move
expressions that don't depend on the context to an outer level in
the containing expression
XPathException
- if any error is detectedpublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic Iterator iterateSubExpressions()
iterateSubExpressions
in class Expression
public boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression
in class Expression
original
- the original subexpressionreplacement
- the replacement subexpression
public SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in interface SequenceIterable
iterate
in class Expression
context
- supplies the context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic void process(XPathContext context) throws XPathException
process
in class Expression
context
- The dynamic context, giving access to the current node,
the current variables, etc.
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |