Class UnaryExpression
- java.lang.Object
-
- jadex.rules.parser.conditions.javagrammar.Expression
-
- jadex.rules.parser.conditions.javagrammar.UnaryExpression
-
public class UnaryExpression extends Expression
An unary operation operates on one value.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
operator
The operator.static java.lang.String
OPERATOR_BNOT
The bitwise not operator "~".static java.lang.String
OPERATOR_MINUS
The (unary) minus operator "-".static java.lang.String
OPERATOR_NOT
The not operator "!".protected Expression
value
The value expression.
-
Constructor Summary
Constructors Constructor Description UnaryExpression(Expression value, java.lang.String operator)
Create a new unary 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 expression is equal to some object.java.lang.Object
getOperator()
Get the operator.Expression
getValue()
Get the value.int
hashCode()
Get the hash code of this expression.java.lang.String
toString()
Get a string representation of this expression.
-
-
-
Field Detail
-
OPERATOR_NOT
public static final java.lang.String OPERATOR_NOT
The not operator "!".- See Also:
- Constant Field Values
-
OPERATOR_MINUS
public static final java.lang.String OPERATOR_MINUS
The (unary) minus operator "-".- See Also:
- Constant Field Values
-
OPERATOR_BNOT
public static final java.lang.String OPERATOR_BNOT
The bitwise not operator "~".- See Also:
- Constant Field Values
-
value
protected Expression value
The value expression.
-
operator
protected java.lang.String operator
The operator.
-
-
Constructor Detail
-
UnaryExpression
public UnaryExpression(Expression value, java.lang.String operator)
Create a new unary 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.
-
getValue
public Expression getValue()
Get the value.
-
getOperator
public java.lang.Object getOperator()
Get the operator.
-
toString
public java.lang.String toString()
Get a string representation of this expression.- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Test if this expression is equal to some object.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Get the hash code of this expression.- Overrides:
hashCode
in classjava.lang.Object
-
-