Class OperationExpression
- java.lang.Object
-
- jadex.rules.parser.conditions.javagrammar.Expression
-
- jadex.rules.parser.conditions.javagrammar.OperationExpression
-
public class OperationExpression extends Expression
An operation composes two values.
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionleftThe left value expression.protected java.lang.ObjectoperatorThe operator.static IOperatorOPERATOR_ANDThe AND operator (&&).static IOperatorOPERATOR_ORThe OR operator (||).protected ExpressionrightThe right value expression.
-
Constructor Summary
Constructors Constructor Description OperationExpression(Expression left, Expression right, IFunction operator)Create a new operation.OperationExpression(Expression left, Expression right, IOperator operator)Create a new operation.
-
Method Summary
All Methods Static 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 operation is equal to some object.static IOperatorgetInverseOperator0(IOperator operator)Get the inverse operator.ExpressiongetLeftValue()Get the left value.java.lang.ObjectgetOperator()Get the operator.ExpressiongetRightValue()Get the right value.inthashCode()Get the hash code of this operation.java.lang.StringtoString()Get a string representation of this operation.
-
-
-
Field Detail
-
OPERATOR_OR
public static final IOperator OPERATOR_OR
The OR operator (||).
-
OPERATOR_AND
public static final IOperator OPERATOR_AND
The AND operator (&&).
-
left
protected Expression left
The left value expression.
-
right
protected Expression right
The right value expression.
-
operator
protected java.lang.Object operator
The operator.
-
-
Constructor Detail
-
OperationExpression
public OperationExpression(Expression left, Expression right, IOperator operator)
Create a new operation.
-
OperationExpression
public OperationExpression(Expression left, Expression right, IFunction operator)
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.
-
getLeftValue
public Expression getLeftValue()
Get the left value.
-
getRightValue
public Expression getRightValue()
Get the right value.
-
getOperator
public java.lang.Object getOperator()
Get the operator.
-
toString
public java.lang.String toString()
Get a string representation of this operation.- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Test if this operation is equal to some object.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Get the hash code of this operation.- Overrides:
hashCodein classjava.lang.Object
-
-