net.scheinerman.phoenix.interpreter.parser.operators
Class NotOperatorNode

java.lang.Object
  extended by net.scheinerman.phoenix.interpreter.parser.operators.OperatorNode
      extended by net.scheinerman.phoenix.interpreter.parser.operators.NotOperatorNode
All Implemented Interfaces:
ParserTreeNode

public class NotOperatorNode
extends OperatorNode

Provides the implementation of the Not [!] operator in the parsing tree when parsing expressions.

Since:
1.5
Version:
1.0
Author:
Jonah Scheinerman

Constructor Summary
NotOperatorNode(ParserTreeNode right)
           
 
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 net.scheinerman.phoenix.interpreter.parser.operators.OperatorNode
isLeftOperandUnary, isParenthesized, left, left, right, right, setParenthesized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotOperatorNode

public NotOperatorNode(ParserTreeNode right)
Method Detail

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.