lt.monarch.math
Class AbstractFormulaParser.AbstractNode

java.lang.Object
  extended by lt.monarch.math.AbstractFormulaParser.AbstractNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Enclosing class:
AbstractFormulaParser

protected abstract class AbstractFormulaParser.AbstractNode
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Abstract node interface

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  AbstractFormulaParser.AbstractNode left
          Left side of the node
protected  AbstractFormulaParser.AbstractNode right
          Right side of the node
 
Constructor Summary
Modifier Constructor and Description
protected AbstractFormulaParser.AbstractNode()
           
 
Method Summary
Modifier and Type Method and Description
protected abstract  java.lang.Object clone()
          Clones the node
abstract  java.lang.Double eval()
          Evaluates the node value
protected  AbstractFormulaParser.AbstractNode getLeft()
          Gets left side of the node
protected  AbstractFormulaParser.AbstractNode getRight()
          Gets right side of the node
 void setLeft(AbstractFormulaParser.AbstractNode left)
          Sets left side of the node
 void setRight(AbstractFormulaParser.AbstractNode right)
          Sets the right side of the node
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

protected AbstractFormulaParser.AbstractNode left
Left side of the node


right

protected AbstractFormulaParser.AbstractNode right
Right side of the node

Constructor Detail

AbstractFormulaParser.AbstractNode

protected AbstractFormulaParser.AbstractNode()
Method Detail

getLeft

protected AbstractFormulaParser.AbstractNode getLeft()
                                              throws java.lang.NullPointerException
Gets left side of the node

Returns:
left side of the node
Throws:
java.lang.NullPointerException - throws null pointer exception if not set.

setLeft

public void setLeft(AbstractFormulaParser.AbstractNode left)
Sets left side of the node

Parameters:
left - left side of the node

getRight

protected AbstractFormulaParser.AbstractNode getRight()
                                               throws java.lang.NullPointerException
Gets right side of the node

Returns:
right side of the node
Throws:
java.lang.NullPointerException - throws null pointer exception if can't return

setRight

public void setRight(AbstractFormulaParser.AbstractNode right)
Sets the right side of the node

Parameters:
right - right side of the node

eval

public abstract java.lang.Double eval()
                               throws java.lang.NullPointerException
Evaluates the node value

Returns:
node value
Throws:
java.lang.NullPointerException - throws null pointer exception if can't perform evaluation

clone

protected abstract java.lang.Object clone()
Clones the node

Overrides:
clone in class java.lang.Object