public class IfElseMacro extends java.lang.Object implements MacroDeclarations, Macro
ifelse function.
The ifelse macro can be used as follows:
ifelse(condition, ifpart, elsepart)
Whith the following constraints:
ifelse(A < B, true, A = B)ifelse(A = B, 4.0^2, 1/5)ifelse(A > B, 'bigger', 'smaller')| Constructor and Description |
|---|
IfElseMacro() |
| Modifier and Type | Method and Description |
|---|---|
Node |
evaluate(Node... params)
Evaluates the ifelse macro
|
Macro |
getMacro(java.lang.String name)
Tries to fetch the macro
|
boolean |
hasMacro(java.lang.String name)
Whether the macro is declared
|
public boolean hasMacro(java.lang.String name)
hasMacro in interface MacroDeclarationsname - name of the macropublic Macro getMacro(java.lang.String name)
MacroDeclarations applies here too.getMacro in interface MacroDeclarationsname - name of the macropublic Node evaluate(Node... params) throws SemanticException
evaluate in interface Macroparams - the parametersSemanticException