public class CaseSwitchExpression extends ExpressionBase
The first child expression provides the value to switch on. The following pairs of child expressions provide the "when expression then expression" results. The last child expression provides the "else" result.
Constructor and Description |
---|
CaseSwitchExpression()
Ctor - for use to create an expression tree, without inner expression
|
CaseSwitchExpression(Expression switchValue)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
CaseSwitchExpression |
add(Expression when,
Expression then)
Adds a pair of expressions representing a "when" and a "then" in the switch.
|
ExpressionPrecedenceEnum |
getPrecedence()
Returns precedence.
|
CaseSwitchExpression |
setElse(Expression elseExpr)
Sets the else-part of the case-switch.
|
void |
toPrecedenceFreeEPL(StringWriter writer)
Renders the expressions and all it's child expression, in full tree depth, as a string in
language syntax.
|
addChild, getChildren, getTreeObjectName, renderAggregation, setChildren, setTreeObjectName, toEPL, toPrecedenceFreeEPL, toPrecedenceFreeEPL
public CaseSwitchExpression()
public CaseSwitchExpression(Expression switchValue)
switchValue
- is the expression providing the value to switch onpublic CaseSwitchExpression add(Expression when, Expression then)
when
- expression to match onthen
- expression to return a conditional result when the when-expression matchespublic CaseSwitchExpression setElse(Expression elseExpr)
elseExpr
- is the expression returning the no-match valuepublic ExpressionPrecedenceEnum getPrecedence()
Expression
public void toPrecedenceFreeEPL(StringWriter writer)
ExpressionBase
toPrecedenceFreeEPL
in class ExpressionBase
writer
- is the output to use