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,Serializable
Boolean node performs mathematical operations on it's (two) child nodes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe and (&&) operator.static final intThe not (!) operator.protected intThe operation.static final intThe or (||) operator.Fields inherited from class jadex.javaparser.javaccimpl.ExpressionNode
constant, constant_value, expressiontext, imports, static_type, textFields inherited from class jadex.javaparser.javaccimpl.SimpleNode
children, id, parent -
Constructor Summary
ConstructorsConstructorDescriptionBooleanNode(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create a node. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if two nodes are equal.static intfromString(String operator) Convert an operator from a string representation.getValue(jadex.common.IValueFetcher fetcher) Evaluate the expression in the given state with respect to given parameters.inthashCode()Get the hash code for the node.voidCheck argument types, and precompute expression when some children are constant.voidSet the token text.Create a string representation of this node and its subnodes.static 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, toStringMethods inherited from class jadex.javaparser.javaccimpl.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
-
Field Details
-
AND
public static final int ANDThe and (&&) operator.- See Also:
-
OR
public static final int ORThe or (||) operator.- See Also:
-
NOT
public static final int NOTThe not (!) operator.- See Also:
-
op
protected int opThe operation.
-
-
Constructor Details
-
BooleanNode
public BooleanNode(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create a node.- Parameters:
p- The parser.id- The id.
-
-
Method Details
-
setText
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
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
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
Convert an operator to a string representation.- Parameters:
operator- The operator.- Returns:
- A string representation of the operator.
-
fromString
Convert an operator from a string representation.- Parameters:
operator- The operator as string.- Returns:
- The int value of the operator.
-
equals
Test if two nodes are equal.- Overrides:
equalsin classExpressionNode
-
hashCode
public int hashCode()Get the hash code for the node.- Overrides:
hashCodein classExpressionNode
-