com.graphbuilder.math
Class TermNode
java.lang.Object
com.graphbuilder.math.Expression
com.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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
name
protected java.lang.String name
negate
protected boolean negate
TermNode
public TermNode(java.lang.String name,
boolean negate)
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.