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 Expression
left
The left value expression.protected java.lang.Object
operator
The operator.static IOperator
OPERATOR_AND
The AND operator (&&).static IOperator
OPERATOR_OR
The OR operator (||).protected Expression
right
The 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 boolean
containsVariable(Variable var)
Test if a variable is contained in the expression.boolean
equals(java.lang.Object o)
Test if this operation is equal to some object.static IOperator
getInverseOperator0(IOperator operator)
Get the inverse operator.Expression
getLeftValue()
Get the left value.java.lang.Object
getOperator()
Get the operator.Expression
getRightValue()
Get the right value.int
hashCode()
Get the hash code of this operation.java.lang.String
toString()
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:
containsVariable
in 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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Test if this operation is equal to some object.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Get the hash code of this operation.- Overrides:
hashCode
in classjava.lang.Object
-
-