net.scheinerman.phoenix.interpreter.parser.operators
Class DivideOperatorNode
java.lang.Object
net.scheinerman.phoenix.interpreter.parser.operators.OperatorNode
net.scheinerman.phoenix.interpreter.parser.operators.DivideOperatorNode
- All Implemented Interfaces:
- ParserTreeNode
public class DivideOperatorNode
- extends OperatorNode
Provides the implementation of the Divide [/] operator in the parsing tree when parsing expressions.
- Since:
- 1.5
- Version:
- 1.0
- Author:
- Jonah Scheinerman
Method Summary |
int |
getPrecedence()
Returns the precedence of the node in the order of operations, when it should be evaluated in the
tree. |
Variable |
operate()
Parses this operator, by operating on the left and right hand arguments and then combining
the results in some implementation specific manner. |
java.lang.String |
operator()
Returns the string representation of this operator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DivideOperatorNode
public DivideOperatorNode(ParserTreeNode left,
ParserTreeNode right)
operate
public Variable operate()
- Description copied from class:
OperatorNode
- Parses this operator, by operating on the left and right hand arguments and then combining
the results in some implementation specific manner.
- Specified by:
operate
in interface ParserTreeNode
- Overrides:
operate
in class OperatorNode
- Returns:
- The variable result of the operation.
operator
public java.lang.String operator()
- Description copied from class:
OperatorNode
- Returns the string representation of this operator. For example, in the case of the add operator, the
string
"+"
is returned.
- Specified by:
operator
in class OperatorNode
- Returns:
- A string representation of this operator symbol.
getPrecedence
public int getPrecedence()
- Description copied from interface:
ParserTreeNode
- Returns the precedence of the node in the order of operations, when it should be evaluated in the
tree. The precedence is an integer, the higher the integer, the higher the precedence, meaning that
this node will be evaluated sooner than those of lower precedence.
- Specified by:
getPrecedence
in interface ParserTreeNode
- Specified by:
getPrecedence
in class OperatorNode
- Returns:
- A number representing the precedence of this node.