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 int
The and (invalid input: '&'invalid input: '&') operator.static final int
The not (!) operator.protected int
The operation.static final int
The 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
ConstructorsConstructorDescriptionBooleanNode
(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create a node. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if two nodes are equal.static int
fromString
(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.int
hashCode()
Get the hash code for the node.void
Check argument types, and precompute expression when some children are constant.void
Set the token text.Create a string representation of this node and its subnodes.static String
toString
(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 Details
-
AND
public static final int ANDThe and (invalid input: '&'invalid input: '&') 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:
setText
in classExpressionNode
- Parameters:
text
- The token text.
-
precompile
public void precompile()Check argument types, and precompute expression when some children are constant.- Overrides:
precompile
in classExpressionNode
-
getValue
Evaluate the expression in the given state with respect to given parameters.- Specified by:
getValue
in interfaceIParsedExpression
- Specified by:
getValue
in 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:
toPlainString
in interfaceNode
- Overrides:
toPlainString
in 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:
equals
in classExpressionNode
-
hashCode
public int hashCode()Get the hash code for the node.- Overrides:
hashCode
in classExpressionNode
-