Package com.bayesserver
Class FunctionVariableExpression
- java.lang.Object
-
- com.bayesserver.FunctionVariableExpression
-
- All Implemented Interfaces:
Expression
,QueryExpression
,Cloneable
public final class FunctionVariableExpression extends Object implements QueryExpression, Cloneable
An expression that can be used in a function node/variable.
-
-
Constructor Summary
Constructors Constructor Description FunctionVariableExpression(String text, ExpressionReturnType returnType)
Creates a new function node expression.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
copy()
Creates a copy of the expression.Variable
getOwner()
Gets the current owner, if assigned to a variable.ExpressionReturnType
getReturnType()
Gets the return type of the expression.String
getText()
Gets the expression text.void
setReturnType(ExpressionReturnType value)
void
setText(String value)
Sets the expression text.static void
validateSyntax(String expr)
Validates the syntax of a function expression.
-
-
-
Constructor Detail
-
FunctionVariableExpression
public FunctionVariableExpression(String text, ExpressionReturnType returnType)
Creates a new function node expression.- Parameters:
text
- The expression text.returnType
- The return type of the expression.
-
-
Method Detail
-
copy
public Expression copy()
Creates a copy of the expression. The new expression will not have an owner.- Specified by:
copy
in interfaceExpression
- Returns:
- A copy of the expression.
-
validateSyntax
public static void validateSyntax(String expr)
Validates the syntax of a function expression. This method only checks the syntax, and does not ensure the expression will evaluate without errors.- Parameters:
expr
- The expression string to test.
-
getText
public String getText()
Gets the expression text.- Specified by:
getText
in interfaceExpression
-
setText
public void setText(String value)
Sets the expression text.- Specified by:
setText
in interfaceExpression
-
getOwner
public Variable getOwner()
Gets the current owner, if assigned to a variable. An expression cannot be modified when it is assigned to a variable.- Specified by:
getOwner
in interfaceQueryExpression
-
getReturnType
public ExpressionReturnType getReturnType()
Gets the return type of the expression.- Specified by:
getReturnType
in interfaceExpression
-
setReturnType
public void setReturnType(ExpressionReturnType value)
-
-