Package jadex.javaparser.javaccimpl
Class BooleanNode
- java.lang.Object
-
- jadex.javaparser.javaccimpl.SimpleNode
-
- jadex.javaparser.javaccimpl.ExpressionNode
-
- jadex.javaparser.javaccimpl.BooleanNode
-
- All Implemented Interfaces:
IParsedExpression,Node,java.io.Serializable
public class BooleanNode extends ExpressionNode
Boolean node performs mathematical operations on it's (two) child nodes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intANDThe and (&&) operator.static intNOTThe not (!) operator.protected intopThe operation.static intORThe or (||) operator.-
Fields inherited from class jadex.javaparser.javaccimpl.ExpressionNode
constant, constant_value, expressiontext, imports, static_type, text
-
Fields inherited from class jadex.javaparser.javaccimpl.SimpleNode
children, id, parent
-
-
Constructor Summary
Constructors Constructor Description BooleanNode(jadex.javaparser.javaccimpl.ParserImpl p, int id)Create a node.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Test if two nodes are equal.static intfromString(java.lang.String operator)Convert an operator from a string representation.java.lang.ObjectgetValue(IValueFetcher fetcher)Evaluate the expression in the given state with respect to given parameters.inthashCode()Get the hash code for the node.voidprecompile()Check argument types, and precompute expression when some children are constant.voidsetText(java.lang.String text)Set the token text.java.lang.StringtoPlainString()Create a string representation of this node and its subnodes.static java.lang.StringtoString(int operator)Convert an operator to a string representation.-
Methods inherited from class jadex.javaparser.javaccimpl.ExpressionNode
appendText, getConstantValue, getExpressionText, getParameters, getStaticType, getText, getUnboundParameterNodes, isConstant, precompileTree, setConstant, setConstantValue, setExpressionText, setStaticType, subnodeToString, throwEvaluationException, throwParseException, toString, toString
-
Methods inherited from class jadex.javaparser.javaccimpl.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
-
-
-
-
Field Detail
-
AND
public static final int AND
The and (&&) operator.- See Also:
- Constant Field Values
-
OR
public static final int OR
The or (||) operator.- See Also:
- Constant Field Values
-
NOT
public static final int NOT
The not (!) operator.- See Also:
- Constant Field Values
-
op
protected int op
The operation.
-
-
Method Detail
-
setText
public void setText(java.lang.String text)
Set the token text.- Overrides:
setTextin classExpressionNode- Parameters:
text- The token text.
-
precompile
public void precompile()
Check argument types, and precompute expression when some children are constant.- Overrides:
precompilein classExpressionNode
-
getValue
public java.lang.Object getValue(IValueFetcher fetcher)
Evaluate the expression in the given state with respect to given parameters.- Specified by:
getValuein interfaceIParsedExpression- Specified by:
getValuein classExpressionNode- Parameters:
params- The parameters (string, value pairs), if any.- Returns:
- The value of the term.
-
toPlainString
public java.lang.String toPlainString()
Create a string representation of this node and its subnodes.- Specified by:
toPlainStringin interfaceNode- Overrides:
toPlainStringin classExpressionNode- Returns:
- A string representation of this node.
-
toString
public static java.lang.String toString(int operator)
Convert an operator to a string representation.- Parameters:
operator- The operator.- Returns:
- A string representation of the operator.
-
fromString
public static int fromString(java.lang.String operator)
Convert an operator from a string representation.- Parameters:
operator- The operator as string.- Returns:
- The int value of the operator.
-
equals
public boolean equals(java.lang.Object o)
Test if two nodes are equal.- Overrides:
equalsin classExpressionNode
-
hashCode
public int hashCode()
Get the hash code for the node.- Overrides:
hashCodein classExpressionNode
-
-