Class ConditionalExpression
- java.lang.Object
-
- jadex.rules.parser.conditions.javagrammar.Expression
-
- jadex.rules.parser.conditions.javagrammar.ConditionalExpression
-
public class ConditionalExpression extends Expression
A conditional operation uses a condition to choose from two values: condition ? first_value : second_value
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionconditionThe condition.protected ExpressionfirstThe first value expression.static IFunctionFUNCTION_CONDITIONALA function to evaluate conditionals.protected ExpressionsecondThe second value expression.
-
Constructor Summary
Constructors Constructor Description ConditionalExpression(Expression condition, Expression first, Expression second)Create a new operation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsVariable(Variable var)Test if a variable is contained in the expression.booleanequals(java.lang.Object o)Test if this constraint is equal to some object.ExpressiongetCondition()Get the condition.ExpressiongetFirstValue()Get the first value.ExpressiongetSecondValue()Get the second value.inthashCode()Get the hash code of this field access.java.lang.StringtoString()Get a string representation of this constraint.
-
-
-
Field Detail
-
FUNCTION_CONDITIONAL
public static final IFunction FUNCTION_CONDITIONAL
A function to evaluate conditionals.
-
condition
protected Expression condition
The condition.
-
first
protected Expression first
The first value expression.
-
second
protected Expression second
The second value expression.
-
-
Constructor Detail
-
ConditionalExpression
public ConditionalExpression(Expression condition, Expression first, Expression second)
Create a new operation.
-
-
Method Detail
-
containsVariable
public boolean containsVariable(Variable var)
Test if a variable is contained in the expression.- Specified by:
containsVariablein classExpression- Parameters:
var- The variable.- Returns:
- True, when the variable is contained.
-
getCondition
public Expression getCondition()
Get the condition.
-
getFirstValue
public Expression getFirstValue()
Get the first value.
-
getSecondValue
public Expression getSecondValue()
Get the second value.
-
toString
public java.lang.String toString()
Get a string representation of this constraint.- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Test if this constraint is equal to some object.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Get the hash code of this field access.- Overrides:
hashCodein classjava.lang.Object
-
-