Package org.openrefine.grel.ast
Class ControlCallExpr
- java.lang.Object
-
- org.openrefine.grel.ast.PureArgumentsExpr
-
- org.openrefine.grel.ast.ControlCallExpr
-
- All Implemented Interfaces:
Serializable,GrelExpr
public class ControlCallExpr extends PureArgumentsExpr
An abstract syntax tree node encapsulating a control call, such as "if".- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Control_control-
Fields inherited from class org.openrefine.grel.ast.PureArgumentsExpr
_args
-
-
Constructor Summary
Constructors Constructor Description ControlCallExpr(GrelExpr[] args, Control c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Objectevaluate(Properties bindings)Returns the value of the expression in a given context.ControlCallExprrenameColumnDependencies(Map<String,String> substitutions)Translates this expression by simultaneously substituting column names as the supplied map specifies.StringtoString()For GREL expressions, toString should return the source code of the expression, or a source code for an equivalent expression.-
Methods inherited from class org.openrefine.grel.ast.PureArgumentsExpr
getColumnDependencies, isLocal
-
-
-
-
Field Detail
-
_control
protected final Control _control
-
-
Method Detail
-
evaluate
public Object evaluate(Properties bindings)
Description copied from interface:GrelExprReturns the value of the expression in a given context.- Parameters:
bindings- the evaluation context, mapping variable names to their values- Returns:
- the result of the evaluation of the expression
-
toString
public String toString()
Description copied from interface:GrelExprFor GREL expressions, toString should return the source code of the expression, or a source code for an equivalent expression. (without the "grel:" prefix).
-
renameColumnDependencies
public ControlCallExpr renameColumnDependencies(Map<String,String> substitutions)
Description copied from interface:GrelExprTranslates this expression by simultaneously substituting column names as the supplied map specifies.This is only possible if the extraction of column dependencies with
GrelExpr.getColumnDependencies(String)succeeds (return a non-null value).- Parameters:
substitutions- a map specifying new names for some columns. If a column name is not present in the map, it is assumed that the column is not renamed.- Returns:
- a new expression with updated column names.
-
-