com.graphbuilder.math
Class TermNode

java.lang.Object
  extended bycom.graphbuilder.math.Expression
      extended bycom.graphbuilder.math.TermNode
Direct Known Subclasses:
FuncNode, VarNode

public abstract class TermNode
extends Expression

A node of an expression tree that represents a variable or a function.


Field Summary
protected  java.lang.String name
           
protected  boolean negate
           
 
Fields inherited from class com.graphbuilder.math.Expression
parent
 
Constructor Summary
TermNode(java.lang.String name, boolean negate)
           
 
Method Summary
 java.lang.String getName()
          Returns the name of the term.
 boolean getNegate()
          Returns true if the term should negate the result before returning it in the eval method.
 void setName(java.lang.String s)
          Sets the name of the term.
 void setNegate(boolean b)
           
 
Methods inherited from class com.graphbuilder.math.Expression
checkBeforeAccept, eval, getFunctionNames, getParent, getVariableNames, isDescendent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

negate

protected boolean negate
Constructor Detail

TermNode

public TermNode(java.lang.String name,
                boolean negate)
Method Detail

getNegate

public boolean getNegate()
Returns true if the term should negate the result before returning it in the eval method.


setNegate

public void setNegate(boolean b)

getName

public java.lang.String getName()
Returns the name of the term.


setName

public void setName(java.lang.String s)
Sets the name of the term. Valid names must not begin with a digit or a decimal, and must not contain round brackets, operators, commas or whitespace.

Throws:
java.lang.IllegalArgumentException - If the name is null or invalid.