Class Addition

java.lang.Object
  |
  +--BinaryOperator
        |
        +--Addition
All Implemented Interfaces:
Node

public class Addition
extends BinaryOperator

Represents the Addition operator.


Fields inherited from class BinaryOperator
left, right
 
Constructor Summary
Addition(Node left, Node right)
          Constructs an Addition operator
 
Method Summary
 int getValue()
          Returns the sum of the values of the children nodes.
 String toString()
          Returns a plus sign with no surrounding spaces.
 
Methods inherited from class BinaryOperator
getChild, getNumChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Addition

public Addition(Node left,
                Node right)
Constructs an Addition operator
Parameters:
left - Child 0
right - Child 1
Method Detail

getValue

public int getValue()
Returns the sum of the values of the children nodes.
Overrides:
getValue in class BinaryOperator

toString

public String toString()
Returns a plus sign with no surrounding spaces. "+"
Overrides:
toString in class BinaryOperator