public class AstIfElse extends AstPrimitive
"NaNs poison". If the test is a NaN, evaluate neither side and return a NaN
"Frames poison". If the test is a Frame, both sides are evaluated and selected between according to the test. The result is a Frame. All Frames must be compatible, and scalars and 1-column Frames are widened to match the widest frame. NaN test values produce NaN results.
If the test is a scalar, then only the returned side is evaluated. If both sides are scalars or frames, then the evaluated result is returned. The unevaluated side is not checked for being a compatible frame. It is an error if one side is typed as a scalar and the other as a Frame.
Constructor and Description |
---|
AstIfElse() |
Modifier and Type | Method and Description |
---|---|
Val |
apply(Env env,
Env.StackHelp stk,
AstRoot[] asts)
Primary method to invoke this function, passing all the parameters
as the `asts` list.
|
java.lang.String[] |
args()
List of argument names.
|
int |
nargs()
Number of function's arguments + 1.
|
java.lang.String |
str()
String representation of this Ast object in the Rapids language.
|
description, example, exec
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public java.lang.String[] args()
AstPrimitive
args
in class AstPrimitive
public int nargs()
AstPrimitive
nargs
in class AstPrimitive
public java.lang.String str()
AstRoot
AstPrimitive
s this is the name of the function; for
AstParameter
s this is either the name of the variable, or the
value of the numeric constant that the parameter represents. For more
complicated constructs such as AstExec
or AstFunction
this method should return those objects as a Rapids string.public Val apply(Env env, Env.StackHelp stk, AstRoot[] asts)
AstPrimitive
Primary method to invoke this function, passing all the parameters as the `asts` list.
apply
in class AstPrimitive
env
- Current execution environment. Variables are looked up here.stk
- TODO need clarificationasts
- List of AstRoot expressions that are arguments to the
function. First element in this list is the function itself.