net.scheinerman.phoenix.interpreter.parser.operators
Class FunctionReferenceOperatorNode
java.lang.Object
net.scheinerman.phoenix.interpreter.parser.operators.OperatorNode
net.scheinerman.phoenix.interpreter.parser.operators.FunctionReferenceOperatorNode
- All Implemented Interfaces:
- ParserTreeNode
public class FunctionReferenceOperatorNode
- extends OperatorNode
Method Summary |
int |
getPrecedence()
Returns the precedence of the node in the order of operations, when it should be evaluated in the
tree. |
boolean |
isUnary()
Returns whether or not this operator is unary, meaning that it only accepts one operand on the right
or the left. |
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. |
java.lang.String |
toString()
Returns a string in the form: "(" + left().toString() + operator() + right().toString() + ")" . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
i
private Interpreter i
FunctionReferenceOperatorNode
public FunctionReferenceOperatorNode(Interpreter i,
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.
isUnary
public boolean isUnary()
- Description copied from class:
OperatorNode
- Returns whether or not this operator is unary, meaning that it only accepts one operand on the right
or the left. To specify what operand it takes, the
isLeftOperandUnary()
method is used.
By default, this method returns false
.
- Overrides:
isUnary
in class OperatorNode
- Returns:
true
if it is unary, false
if not.
toString
public java.lang.String toString()
- Description copied from class:
OperatorNode
- Returns a string in the form:
"(" + left().toString() + operator() + right().toString() + ")"
.
- Overrides:
toString
in class OperatorNode
- Returns:
- A string form of this section of the parsing tree.