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 Expression
condition
The condition.protected Expression
first
The first value expression.static IFunction
FUNCTION_CONDITIONAL
A function to evaluate conditionals.protected Expression
second
The 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 boolean
containsVariable(Variable var)
Test if a variable is contained in the expression.boolean
equals(java.lang.Object o)
Test if this constraint is equal to some object.Expression
getCondition()
Get the condition.Expression
getFirstValue()
Get the first value.Expression
getSecondValue()
Get the second value.int
hashCode()
Get the hash code of this field access.java.lang.String
toString()
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:
containsVariable
in 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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Test if this constraint is equal to some object.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Get the hash code of this field access.- Overrides:
hashCode
in classjava.lang.Object
-
-