public final class FunctionCondition extends Condition
Condition
that represents a condition that evaluates a FunctionArgument
that produces a Boolean value. For example, the following code creates a FunctionCondition
for the LNNVL
function.
NumberExpression rhsArg = new NumberExpression(.2); StringExpression lhsArg = new StringExpression("commission_pct"); ValueComparisonCondition funcArg = new ValueComparisonCondition(lhsArg, ValueComparisonCondition.LT, rhsArg); FunctionCondition fc = new FunctionCondition("LNNVL", funcArg);
The toSyntax
method of the fc
object returns a String
that contains the following:
LNNVL('commission_pct' < 0.2)
You can create the same FunctionCondition
by using the SyntaxObject.fromSyntax
method, as in the following, where metadataProvider
is an MdmMetadataProvider
:
FunctionCondition fc = (FunctionCondition) SyntaxObject.fromSyntax("LNNVL('commission_pct' < .2)", metadataProvider);
Constructor and Description |
---|
FunctionCondition(java.lang.String functionName)
Creates a
FunctionCondition that has the specified function, which requires no arguments. |
FunctionCondition(java.lang.String functionName, FunctionArgument arg1)
Creates a
FunctionCondition that has the specified function, which takes one argument. |
FunctionCondition(java.lang.String functionName, FunctionArgument[] args)
Creates a
FunctionCondition that has the specified function. |
FunctionCondition(java.lang.String functionName, FunctionArgument arg1, FunctionArgument arg2)
Creates a
FunctionCondition that has the specified function, which takes two arguments. |
FunctionCondition(java.lang.String functionName, FunctionArgument arg1, FunctionArgument arg2, FunctionArgument arg3)
Creates a
FunctionCondition that has the specified function, which takes three arguments. |
FunctionCondition(java.lang.String functionName, FunctionArgument arg1, FunctionArgument arg2, FunctionArgument arg3, FunctionArgument arg4)
Creates a
FunctionCondition that has the specified function, which takes four arguments. |
FunctionCondition(java.lang.String functionName, java.util.List<FunctionArgument> args) |
Modifier and Type | Method and Description |
---|---|
FunctionArgument[] |
getArguments()
Gets the arguments for this
FunctionCondition . |
FunctionDescriptor |
getFunctionDescriptor()
Gets the
FunctionDescriptor for this FunctionCondition . |
java.lang.String |
getFunctionName()
Gets the name of the function that this
FunctionCondition represents. |
java.lang.Object |
visit(SyntaxObjectVisitor visitor, java.lang.Object context)
Calls the
visitFunctionCondition method of the SyntaxObjectVisitor and passes that method this FunctionCondition and an Object . |
and, isCompositeObject, not, or
equals, equals, fromSyntax, fromSyntax, fromSyntax, fromSyntax, fromSyntax, isValid, toSyntax, toSyntax, toSyntax, toSyntax, toSyntax, toSyntax
public FunctionCondition(java.lang.String functionName, FunctionArgument[] args)
FunctionCondition
that has the specified function.functionName
- A String
that contains the name of the function.args
- An array of FunctionArgument
objects that have the arguments required by the function.public FunctionCondition(java.lang.String functionName, java.util.List<FunctionArgument> args)
public FunctionCondition(java.lang.String functionName)
FunctionCondition
that has the specified function, which requires no arguments.functionName
- A String
that contains the name of the function.public FunctionCondition(java.lang.String functionName, FunctionArgument arg1)
FunctionCondition
that has the specified function, which takes one argument.functionName
- A String
that contains the name of the function.arg1
- A FunctionArgument
that has the argument required by the function.public FunctionCondition(java.lang.String functionName, FunctionArgument arg1, FunctionArgument arg2)
FunctionCondition
that has the specified function, which takes two arguments.functionName
- A String
that contains the name of the function.arg1
- A FunctionArgument
that has the first argument required by the function.arg2
- A FunctionArgument
that has the second argument required by the function.public FunctionCondition(java.lang.String functionName, FunctionArgument arg1, FunctionArgument arg2, FunctionArgument arg3)
FunctionCondition
that has the specified function, which takes three arguments.functionName
- A String
that contains the name of the function.arg1
- A FunctionArgument
that has the first argument required by the function.arg2
- A FunctionArgument
that has the second argument required by the function.arg3
- A FunctionArgument
that has the third argument required by the function.public FunctionCondition(java.lang.String functionName, FunctionArgument arg1, FunctionArgument arg2, FunctionArgument arg3, FunctionArgument arg4)
FunctionCondition
that has the specified function, which takes four arguments.functionName
- A String
that contains the name of the function.arg1
- A FunctionArgument
that has the first argument required by the function.arg2
- A FunctionArgument
that has the second argument required by the function.arg3
- A FunctionArgument
that has the third argument required by the function.arg4
- A FunctionArgument
that has the fourth argument required by the function.public java.lang.Object visit(SyntaxObjectVisitor visitor, java.lang.Object context)
visitFunctionCondition
method of the SyntaxObjectVisitor
and passes that method this FunctionCondition
and an Object
.visit
in class SyntaxObject
visitor
- A SyntaxObjectVisitor
.context
- An Object
.Object
returned by the visitFunctionCondition
method.public FunctionArgument[] getArguments()
FunctionCondition
.FunctionArgument
objects that are the arguments for this FunctionCondition
.public FunctionDescriptor getFunctionDescriptor()
FunctionDescriptor
for this FunctionCondition
.FunctionDescriptor
for this FunctionCondition
.public java.lang.String getFunctionName()
FunctionCondition
represents.String
that contains the name of the function.